From 50a93e3ca788e0fcc6a3fb020d85136af0edecbc Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Wed, 5 Feb 2014 17:16:25 +0100 Subject: [PATCH] Create database.yml for the built-in postgresql --- files/gitlab-cookbooks/gitlab/recipes/gitlab-core.rb | 15 +++++++++++++++ files/gitlab-cookbooks/gitlab/templates/default/database.yml.postgresql.erb | 10 +++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/files/gitlab-cookbooks/gitlab/recipes/gitlab-core.rb b/files/gitlab-cookbooks/gitlab/recipes/gitlab-core.rb index 4d5ee37..7bcb28d 100644 --- a/files/gitlab-cookbooks/gitlab/recipes/gitlab-core.rb +++ b/files/gitlab-cookbooks/gitlab/recipes/gitlab-core.rb @@ -51,6 +51,21 @@ link "/opt/gitlab/embedded/service/gitlab-core/.secret" do to secret_token_config end +database_yml = File.join(gitlab_core_etc_dir, "database.yml") + +template database_yml do + source "database.yml.postgresql.erb" + owner "root" + group "root" + mode "0644" + variables(node['gitlab']['postgresql'].to_hash) + notifies :restart, 'service[gitlab-core]' if should_notify +end + +link "/opt/gitlab/embedded/service/gitlab-core/config/database.yml" do + to database_yml +end + unicorn_listen_tcp = node['gitlab']['gitlab-core']['listen'] unicorn_listen_tcp << ":#{node['gitlab']['gitlab-core']['port']}" unicorn_listen_socket = node['gitlab']['gitlab-core']['unicorn_socket'] diff --git a/files/gitlab-cookbooks/gitlab/templates/default/database.yml.postgresql.erb b/files/gitlab-cookbooks/gitlab/templates/default/database.yml.postgresql.erb index 6696055..7e4c7f0 100644 --- a/files/gitlab-cookbooks/gitlab/templates/default/database.yml.postgresql.erb +++ b/files/gitlab-cookbooks/gitlab/templates/default/database.yml.postgresql.erb @@ -6,11 +6,11 @@ production: encoding: unicode database: gitlabhq_production pool: 10 - # username: git - # password: - # host: localhost - # port: 5432 - # socket: /tmp/postgresql.sock + username: <%= node['gitlab']['postgresql']['sql_user'] %> + password: <%= node['gitlab']['postgresql']['sql_password'] %> + host: <%= node['gitlab']['postgresql']['listen_address'] %> + port: <%= node['gitlab']['postgresql']['port'] %> +# socket: /tmp/postgresql.sock # # Development specific -- libgit2 0.21.2