Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 1.54 KB

README.md

File metadata and controls

46 lines (35 loc) · 1.54 KB

opsworks_rails_secrets

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"
      }
    }
  }
}

Opsworks Set-Up

  • Add secrets, deploy_to, and symlink_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.

Copyright and License

(c) 2014 Omar Ramos, DigitalTree. See LICENSE for details.

Thanks

Special thanks to Joey Aghion for providing the base of this cookbook.