Merge branch 'db_name_from_attributes' into 'master'

Create db from db name specified in attributes.

Fixes #468

See merge request !314
This commit is contained in:
Marin Jankovski 2015-04-15 09:58:43 +00:00
commit c5dfbe8786
1 changed files with 4 additions and 2 deletions

View File

@ -148,12 +148,14 @@ pg_helper = PgHelper.new(node)
pg_port = node['gitlab']['postgresql']['port']
pg_user = node['gitlab']['postgresql']['username']
bin_dir = "/opt/gitlab/embedded/bin"
database_name = node['gitlab']['gitlab-rails']['db_database']
ci_database_name = node['gitlab']['gitlab-ci']['db_database']
databases = [
['gitlab-rails', 'gitlabhq_production', node['gitlab']['postgresql']['sql_user']]
['gitlab-rails', database_name, node['gitlab']['postgresql']['sql_user']]
]
if node['gitlab']['gitlab-ci']['enable']
databases << ['gitlab-ci', 'gitlab_ci_production', node['gitlab']['postgresql']['sql_ci_user']]
databases << ['gitlab-ci', ci_database_name, node['gitlab']['postgresql']['sql_ci_user']]
end
databases.each do |rails_app, db_name, sql_user|