aws/opsworks-cookbooks — pull request #60 by till (2013-08-31 10:31:38+00:00)
Title: Enhancement: add a node attribute to override the home dir

Current issues:

We run our deployments with the user `www-data`.

Since neither nginx (and www-data) are present when attributes are evaluated,
the "magic" inside the attribute files falls back to `/home/www-data` what
should be `/var/www`.

This behaviour seems due to how and when chef evaluates attribute files. Reloading
ohai during the chef run has no effect.

Depending on the user's OS and the user selected, this may be different.

The current work-arounds include:

* symlinking `/home/www-data` to `/var/www` (hack)
* supplying custom json to set the home (which leads to a new bug)

New bug:

We added the following JSON to our stack settings:

{
"deploy": {
"app1": {
"home": "/var/www"
},
"app2": {
"home": "/var/www"
}
}
}

This lead to another bug:

When an instance shares more than one application, no matter which application
is deployed, the other(s) will be deployed as well because of the logic in
the deploy recipes.

Current work-around for this situation is to check for the `deploying_user` inside
the application loop.

next unless deploy["deploying_user"]

The more we customize in downstream, the more we need to keep up to date with upstream
cookbooks. We're hoping this PR addresses the issues in upstream and hopefully does not
break BC. :)