Skip to content
Snippets Groups Projects
Commit 8ced820a6744 authored by DJ Mountney's avatar DJ Mountney
Browse files

Merge branch 'add-redis-ssl-kas' into 'master'

Add TLS to redis config where required

See merge request gitlab-org/omnibus-gitlab!5632

Changelog: changed
MR: https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/5632
No related branches found
No related tags found
2 merge requests!63Making Heptapod 0.29 the new stable,!62GitLab 14.6
......@@ -30,6 +30,7 @@
redis_sentinels_master_name = node['redis']['master_name']
gitlab_kas_redis_password_file = File.join(working_dir, 'redis_password_file')
redis_network = redis_helper.redis_url.scheme == 'unix' ? 'unix' : 'tcp'
redis_ssl = node['gitlab']['gitlab-rails']['redis_ssl']
redis_address = if redis_network == 'tcp'
"#{redis_host}:#{redis_port}"
else
......@@ -90,6 +91,7 @@
private_api_authentication_secret_file: gitlab_kas_private_api_authentication_secret_file,
redis_network: redis_network,
redis_address: redis_address,
redis_ssl: redis_ssl,
redis_password_file: redis_password ? gitlab_kas_redis_password_file : nil,
redis_sentinels_master_name: redis_sentinels_master_name,
redis_sentinels: redis_sentinels
......
......@@ -22,6 +22,8 @@
usage_reporting_period: <%= @metrics_usage_reporting_period %>s
redis:
network: <%= @redis_network %>
tls:
enabled: <%= @redis_ssl %>
<%- if @redis_password_file %>
password_file: <%= @redis_password_file %>
<%- end %>
......
......@@ -310,6 +310,39 @@
end
end
context 'without sentinel but with tls enabled' do
before do
stub_gitlab_rb(
external_url: 'https://gitlab.example.com',
gitlab_kas: {
enable: true
},
gitlab_rails: {
redis_host: 'the-host',
redis_port: 12345,
redis_ssl: true,
}
)
end
it 'renders a configuration with tls enabled in to the kas config' do
expect(chef_run).to render_file('/var/opt/gitlab/gitlab-kas/gitlab-kas-config.yml').with_content { |content|
kas_redis_cfg = YAML.safe_load(content)['redis']
expect(kas_redis_cfg).to(
include(
'network' => 'tcp',
'tls' => {
'enabled' => true
},
'server' => {
'address' => 'the-host:12345'
}
)
)
}
end
end
context 'with sentinel' do
before do
stub_gitlab_rb(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment