Question

I am deploying an App (from Git) using AWS OpsWorks. By default, OpsWorks writes the files to the server with the user: deploy, and the group: www-data. The file permissions on these files/directories are not group writable, although it looks like they should be: https://github.com/aws/opsworks-cookbooks/blob/master-chef-11.4/deploy/definitions/opsworks_deploy.rb. I was able to change the group to "opsworks" upon deployment by passing custom JSON:

{
  "opsworks": {
    "deploy_user":{
      "group": "opsworks"
    }
  }
}

How can I change the permissions of the deployed files to be group writable?

Was it helpful?

Solution

To update the permissions on the files deployed by opsworks, create a custom Chef recipe. Example:

node[:deploy].each do |application, deploy|
  app_root = "#{deploy[:deploy_to]}/current"
  execute "chmod -R g+rw #{app_root}" do
  end
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top