diff --git a/files/gitlab-cookbooks/gitlab-ee/attributes/default.rb b/files/gitlab-cookbooks/gitlab-ee/attributes/default.rb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWItZWUvYXR0cmlidXRlcy9kZWZhdWx0LnJi..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWItZWUvYXR0cmlidXRlcy9kZWZhdWx0LnJi 100644 --- a/files/gitlab-cookbooks/gitlab-ee/attributes/default.rb +++ b/files/gitlab-cookbooks/gitlab-ee/attributes/default.rb @@ -55,13 +55,13 @@ ### # Geo: Secondary node configuration ### -default['gitlab']['geo-secondary']['enable'] = false -default['gitlab']['geo-secondary']['auto_migrate'] = true -default['gitlab']['geo-secondary']['db_adapter'] = "postgresql" -default['gitlab']['geo-secondary']['db_encoding'] = "unicode" -default['gitlab']['geo-secondary']['db_collation'] = nil -default['gitlab']['geo-secondary']['db_database'] = "gitlabhq_geo_production" -default['gitlab']['geo-secondary']['db_username'] = "gitlab_geo" -default['gitlab']['geo-secondary']['db_password'] = nil -default['gitlab']['geo-secondary']['db_load_balancing'] = { 'hosts' => [] } +default['gitlab']['geo_secondary']['enable'] = false +default['gitlab']['geo_secondary']['auto_migrate'] = true +default['gitlab']['geo_secondary']['db_adapter'] = "postgresql" +default['gitlab']['geo_secondary']['db_encoding'] = "unicode" +default['gitlab']['geo_secondary']['db_collation'] = nil +default['gitlab']['geo_secondary']['db_database'] = "gitlabhq_geo_production" +default['gitlab']['geo_secondary']['db_username'] = "gitlab_geo" +default['gitlab']['geo_secondary']['db_password'] = nil +default['gitlab']['geo_secondary']['db_load_balancing'] = { 'hosts' => [] } # Path to postgresql socket directory @@ -67,13 +67,13 @@ # Path to postgresql socket directory -default['gitlab']['geo-secondary']['db_host'] = "/var/opt/gitlab/geo-postgresql" -default['gitlab']['geo-secondary']['db_port'] = 5431 -default['gitlab']['geo-secondary']['db_socket'] = nil -default['gitlab']['geo-secondary']['db_sslmode'] = nil -default['gitlab']['geo-secondary']['db_sslcompression'] = 0 -default['gitlab']['geo-secondary']['db_sslrootcert'] = nil -default['gitlab']['geo-secondary']['db_sslca'] = nil -default['gitlab']['geo-secondary']['db_prepared_statements'] = false -default['gitlab']['geo-secondary']['db_database_tasks'] = true +default['gitlab']['geo_secondary']['db_host'] = "/var/opt/gitlab/geo-postgresql" +default['gitlab']['geo_secondary']['db_port'] = 5431 +default['gitlab']['geo_secondary']['db_socket'] = nil +default['gitlab']['geo_secondary']['db_sslmode'] = nil +default['gitlab']['geo_secondary']['db_sslcompression'] = 0 +default['gitlab']['geo_secondary']['db_sslrootcert'] = nil +default['gitlab']['geo_secondary']['db_sslca'] = nil +default['gitlab']['geo_secondary']['db_prepared_statements'] = false +default['gitlab']['geo_secondary']['db_database_tasks'] = true ### # Geo: PostgreSQL (Tracking database) @@ -163,3 +163,4 @@ default['gitlab']['geo-logcursor']['env_directory'] = '/opt/gitlab/etc/geo-logcursor/env' default['gitlab']['suggested-reviewers'] = Gitlab::Deprecations::NodeAttribute.new(proc { node['gitlab']['suggested_reviewers'].to_h }, "node['gitlab']['suggested-reviewers']", "node['gitlab']['suggested_reviewers']") +default['gitlab']['geo-secondary'] = Gitlab::Deprecations::NodeAttribute.new(proc { node['gitlab']['geo_secondary'].to_h }, "node['gitlab']['geo-secondary']", "node['gitlab']['geo_secondary']") diff --git a/files/gitlab-cookbooks/gitlab-ee/libraries/geo_secondary.rb b/files/gitlab-cookbooks/gitlab-ee/libraries/geo_secondary.rb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWItZWUvbGlicmFyaWVzL2dlb19zZWNvbmRhcnkucmI=..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWItZWUvbGlicmFyaWVzL2dlb19zZWNvbmRhcnkucmI= 100644 --- a/files/gitlab-cookbooks/gitlab-ee/libraries/geo_secondary.rb +++ b/files/gitlab-cookbooks/gitlab-ee/libraries/geo_secondary.rb @@ -25,7 +25,7 @@ # Set default value for attributes of geo database based on # geo_secondary[`db_*`] settings. geo_database_attributes.each do |attribute| - Gitlab['gitlab_rails']['databases']['geo'][attribute] ||= Gitlab['geo_secondary'][attribute] || node['gitlab']['geo-secondary'][attribute] + Gitlab['gitlab_rails']['databases']['geo'][attribute] ||= Gitlab['geo_secondary'][attribute] || node['gitlab']['geo_secondary'][attribute] end # Set db_migrations_path since Geo migration lives in a non-default place @@ -42,7 +42,7 @@ end def geo_database_attributes - node['gitlab']['geo-secondary'].to_h.keys.select { |k| k.start_with?('db_') } + node['gitlab']['geo_secondary'].to_h.keys.select { |k| k.start_with?('db_') } end def geo_database_enabled? diff --git a/files/gitlab-cookbooks/gitlab-ee/libraries/gitlab_geo_helper.rb b/files/gitlab-cookbooks/gitlab-ee/libraries/gitlab_geo_helper.rb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWItZWUvbGlicmFyaWVzL2dpdGxhYl9nZW9faGVscGVyLnJi..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWItZWUvbGlicmFyaWVzL2dpdGxhYl9nZW9faGVscGVyLnJi 100644 --- a/files/gitlab-cookbooks/gitlab-ee/libraries/gitlab_geo_helper.rb +++ b/files/gitlab-cookbooks/gitlab-ee/libraries/gitlab_geo_helper.rb @@ -4,6 +4,6 @@ def initialize(node) @node = node @status_file_prefix = 'geo-db-migrate' - @attributes_node = node['gitlab']['geo-secondary'] + @attributes_node = node['gitlab']['geo_secondary'] end end diff --git a/files/gitlab-cookbooks/gitlab-ee/recipes/geo-postgresql.rb b/files/gitlab-cookbooks/gitlab-ee/recipes/geo-postgresql.rb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWItZWUvcmVjaXBlcy9nZW8tcG9zdGdyZXNxbC5yYg==..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWItZWUvcmVjaXBlcy9nZW8tcG9zdGdyZXNxbC5yYg== 100644 --- a/files/gitlab-cookbooks/gitlab-ee/recipes/geo-postgresql.rb +++ b/files/gitlab-cookbooks/gitlab-ee/recipes/geo-postgresql.rb @@ -124,7 +124,7 @@ geo_pg_port = node['gitlab']['geo-postgresql']['port'] geo_pg_user = node['gitlab']['geo-postgresql']['sql_user'] geo_pg_user_password = node['gitlab']['geo-postgresql']['sql_user_password'] -geo_database_name = node['gitlab']['geo-secondary']['db_database'] +geo_database_name = node['gitlab']['geo_secondary']['db_database'] if node['gitlab']['geo-postgresql']['enable'] postgresql_user geo_pg_user do diff --git a/files/gitlab-cookbooks/gitlab-ee/templates/default/gitlab-geo-psql-rc.erb b/files/gitlab-cookbooks/gitlab-ee/templates/default/gitlab-geo-psql-rc.erb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWItZWUvdGVtcGxhdGVzL2RlZmF1bHQvZ2l0bGFiLWdlby1wc3FsLXJjLmVyYg==..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWItZWUvdGVtcGxhdGVzL2RlZmF1bHQvZ2l0bGFiLWdlby1wc3FsLXJjLmVyYg== 100644 --- a/files/gitlab-cookbooks/gitlab-ee/templates/default/gitlab-geo-psql-rc.erb +++ b/files/gitlab-cookbooks/gitlab-ee/templates/default/gitlab-geo-psql-rc.erb @@ -2,4 +2,4 @@ psql_group='<%= node['postgresql']['group'] %>' psql_host='<%= node['gitlab']['geo-postgresql']['unix_socket_directory'] %>' psql_port='<%= node['gitlab']['geo-postgresql']['port'] %>' -psql_dbname='<%= node['gitlab']['geo-secondary']['db_database'] %>' +psql_dbname='<%= node['gitlab']['geo_secondary']['db_database'] %>' diff --git a/files/gitlab-cookbooks/gitlab/libraries/helpers/geo_pg_helper.rb b/files/gitlab-cookbooks/gitlab/libraries/helpers/geo_pg_helper.rb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvbGlicmFyaWVzL2hlbHBlcnMvZ2VvX3BnX2hlbHBlci5yYg==..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvbGlicmFyaWVzL2hlbHBlcnMvZ2VvX3BnX2hlbHBlci5yYg== 100644 --- a/files/gitlab-cookbooks/gitlab/libraries/helpers/geo_pg_helper.rb +++ b/files/gitlab-cookbooks/gitlab/libraries/helpers/geo_pg_helper.rb @@ -16,7 +16,7 @@ def connection_info build_connection_info( - node['gitlab']['geo-secondary']['db_database'], + node['gitlab']['geo_secondary']['db_database'], node['gitlab']['geo-postgresql']['unix_socket_directory'], node['gitlab']['geo-postgresql']['port'], node['gitlab']['geo-postgresql']['sql_user'] diff --git a/files/gitlab-cookbooks/package/libraries/deprecations.rb b/files/gitlab-cookbooks/package/libraries/deprecations.rb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9kZXByZWNhdGlvbnMucmI=..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9kZXByZWNhdGlvbnMucmI= 100644 --- a/files/gitlab-cookbooks/package/libraries/deprecations.rb +++ b/files/gitlab-cookbooks/package/libraries/deprecations.rb @@ -69,7 +69,7 @@ note: "Read-only mode is repository specific and always enabled after suspected data loss. See https://docs.gitlab.com/ee/administration/gitaly/praefect.html#read-only-mode" }, { - config_keys: %w(gitlab geo-secondary db_fdw), + config_keys: %w(gitlab geo_secondary db_fdw), deprecation: '13.3', removal: '14.0', # https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6138 note: "Geo does not require Foreign Data Wrapper (FDW) to be configured to replicate data." diff --git a/files/gitlab-cookbooks/package/libraries/settings_dsl.rb b/files/gitlab-cookbooks/package/libraries/settings_dsl.rb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9zZXR0aW5nc19kc2wucmI=..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9zZXR0aW5nc19kc2wucmI= 100644 --- a/files/gitlab-cookbooks/package/libraries/settings_dsl.rb +++ b/files/gitlab-cookbooks/package/libraries/settings_dsl.rb @@ -42,6 +42,7 @@ registry_nginx gitlab_kas_nginx gitlab_kas + geo_secondary ].freeze def self.extended(base) diff --git a/files/gitlab-cookbooks/pgbouncer/recipes/user.rb b/files/gitlab-cookbooks/pgbouncer/recipes/user.rb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wZ2JvdW5jZXIvcmVjaXBlcy91c2VyLnJi..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wZ2JvdW5jZXIvcmVjaXBlcy91c2VyLnJi 100644 --- a/files/gitlab-cookbooks/pgbouncer/recipes/user.rb +++ b/files/gitlab-cookbooks/pgbouncer/recipes/user.rb @@ -26,7 +26,7 @@ helper lazy { GeoPgHelper.new(node) } user node['gitlab']['geo-postgresql']['pgbouncer_user'] password node['gitlab']['geo-postgresql']['pgbouncer_user_password'] - database node['gitlab']['geo-secondary']['db_database'] + database node['gitlab']['geo_secondary']['db_database'] add_auth_function default_auth_query.eql?(auth_query) action :create end diff --git a/files/gitlab-cookbooks/postgresql/resources/config.rb b/files/gitlab-cookbooks/postgresql/resources/config.rb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wb3N0Z3Jlc3FsL3Jlc291cmNlcy9jb25maWcucmI=..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wb3N0Z3Jlc3FsL3Jlc291cmNlcy9jb25maWcucmI= 100644 --- a/files/gitlab-cookbooks/postgresql/resources/config.rb +++ b/files/gitlab-cookbooks/postgresql/resources/config.rb @@ -8,7 +8,7 @@ postgresql_helper = new_resource.helper template postgresql_helper.postgresql_config do - geo_config = { geo_secondary_enabled: node.dig('gitlab', 'geo-secondary', 'enable') } + geo_config = { geo_secondary_enabled: node.dig('gitlab', 'geo_secondary', 'enable') } source 'postgresql.conf.erb' owner new_resource.username mode '0644' diff --git a/spec/chef/cookbooks/package/libraries/settings_dsl_spec.rb b/spec/chef/cookbooks/package/libraries/settings_dsl_spec.rb index 53b5363c14bb0ddd62c7de2e6970be20e56720dd_c3BlYy9jaGVmL2Nvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9zZXR0aW5nc19kc2xfc3BlYy5yYg==..f1bf996d9fb54ac6628d83c8b0b2c62603638f75_c3BlYy9jaGVmL2Nvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9zZXR0aW5nc19kc2xfc3BlYy5yYg== 100644 --- a/spec/chef/cookbooks/package/libraries/settings_dsl_spec.rb +++ b/spec/chef/cookbooks/package/libraries/settings_dsl_spec.rb @@ -38,6 +38,7 @@ %w[remote-syslog remote_syslog], %w[gitlab-workhorse gitlab_workhorse], %w[gitlab-kas gitlab_kas], + %w[geo-secondary geo_secondary], ].each do |input, output| expect(subject.sanitized_key(input)).to eq(output) end