# HG changeset patch
# User Marin Jankovski <maxlazio@gmail.com>
# Date 1421431891 28800
#      Fri Jan 16 10:11:31 2015 -0800
# Node ID 98504d8e6c0b0d243a0d5a9009877e7f48ef2d46
# Parent  7358cb326df57b4fc8ed6831e9afdd25c58603d8
Change the root_password setting to initial_root_password.

diff --git a/doc/settings/database.md b/doc/settings/database.md
--- a/doc/settings/database.md
+++ b/doc/settings/database.md
@@ -55,10 +55,10 @@
 sudo gitlab-ci-rake setup
 ```
 
-If you want to specify a password for the default `root` user, in `gitlab.rb` specify the `root_password` setting:
+If you want to specify a password for the default `root` user, in `gitlab.rb` specify the `initial_root_password` setting:
 
 ```ruby
-  gitlab_rails['root_password'] = 'nonstandardpassword'
+  gitlab_rails['initial_root_password'] = 'nonstandardpassword'
 ```
 
 and then run the `gitlab:setup` command.
diff --git a/files/gitlab-config-template/gitlab.rb.template b/files/gitlab-config-template/gitlab.rb.template
--- a/files/gitlab-config-template/gitlab.rb.template
+++ b/files/gitlab-config-template/gitlab.rb.template
@@ -148,8 +148,10 @@
 # gitlab_rails['rate_limit_requests_per_period'] = 10
 # gitlab_rails['rate_limit_period'] = 60
 
-# Change the default admin password.
-# gitlab_rails['root_password'] = "password"
+# Change the initial default admin password.
+# Only applicable on inital setup, changing this setting after database is created and seeded
+# won't yield any change.
+# gitlab_rails['initial_root_password'] = "password"
 
 ############################
 # GitLab database settings #
diff --git a/files/gitlab-cookbooks/gitlab/attributes/default.rb b/files/gitlab-cookbooks/gitlab/attributes/default.rb
--- a/files/gitlab-cookbooks/gitlab/attributes/default.rb
+++ b/files/gitlab-cookbooks/gitlab/attributes/default.rb
@@ -172,7 +172,7 @@
 
 default['gitlab']['gitlab-rails']['webhook_timeout'] = nil
 
-default['gitlab']['gitlab-rails']['root_password'] = nil
+default['gitlab']['gitlab-rails']['initial_root_password'] = nil
 
 ####
 # Unicorn
diff --git a/files/gitlab-cookbooks/gitlab/recipes/database_migrations.rb b/files/gitlab-cookbooks/gitlab/recipes/database_migrations.rb
--- a/files/gitlab-cookbooks/gitlab/recipes/database_migrations.rb
+++ b/files/gitlab-cookbooks/gitlab/recipes/database_migrations.rb
@@ -15,11 +15,11 @@
 # limitations under the License.
 #
 
-root_password = node['gitlab']['gitlab-rails']['root_password']
+initial_root_password = node['gitlab']['gitlab-rails']['initial_root_password']
 
 execute "initialize gitlab-rails database" do
   command "/opt/gitlab/bin/gitlab-rake db:schema:load db:seed_fu"
-  environment ({'GITLAB_ROOT_PASSWORD' => root_password }) if root_password
+  environment ({'GITLAB_ROOT_PASSWORD' => initial_root_password }) if initial_root_password
   action :nothing
 end