Rails 4.1 cookbook to inject the secrets.yml into the shared config folder.
To use just specify the secrets in the stack's custom JSON. Example:
{
"secrets": {
"app_shortname": {
"production": {
"my_secret": "my_secret_value",
"nested": {
"value1": "1",
"value2": "2"
}
}
}
},
"deploy": {
"app_shortname": {
"symlink_before_migrate": {
"config/secrets.yml": "config/secrets.yml"
}
}
}
}
- Add
secrets
,deploy_to
, andsymlink_before_migrate
attributes to the stack's custom JSON as in the example above. - Associate the
opsworks_rails_secrets::configure
custom recipe with the Deploy event in your rails app's layer.
A deploy isn't necessary if you just want to update the custom configuration. Instead, update the stack's custom JSON, then choose to Run Command > execute recipes and enter opsworks_rails_secrets::configure
into the Recipes to execute field. Executing the recipe will write an updated secrets.yml
file and restart unicorn workers.
(c) 2014 Omar Ramos, DigitalTree. See LICENSE for details.
Special thanks to Joey Aghion for providing the base of this cookbook.