Skip to content

Instantly share code, notes, and snippets.

Created January 9, 2013 21:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4496942 to your computer and use it in GitHub Desktop.
Save anonymous/4496942 to your computer and use it in GitHub Desktop.
#
# PRODUCTION
#
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: gitlabhq_production
pool: 5
username: <%= ENV['PROD_DB_USER'] %>
password: <%= ENV['PROD_DB_PASSWORD'] %>
# host: localhost
# socket: /tmp/mysql.sock
@darron
Copy link

darron commented Jan 9, 2013

This is being put on our server with Chef - like this:

template "/home/gitlab/shared/config/database.yml" do
source "database.yml.erb"
owner "gitlab"
group "gitlab"
mode 0644
end

Currently, it just writes whatever the current ENV variables are in the final database.yml - is there a way to tell Chef to NOT evaluate those Ruby statements during the install? I want it to say:

<%= ENV['PROD_DB_USER'] %> and <%= ENV['PROD_DB_PASSWORD'] %> in the final template.

@darron
Copy link

darron commented Jan 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment