Skip to content
Snippets Groups Projects
Commit 6379c8eb authored by Robert Marshall's avatar Robert Marshall
Browse files

Merge branch 'announce-ip-from-hostname-sentinel' into 'master'

redis: Add announce_ip_from_hostname support to sentinel

See merge request gitlab-org/omnibus-gitlab!6101
parents 8965cdca df69c110
No related branches found
No related tags found
2 merge requests!76heptapod#711: 0.34 is the new stable,!73Sync up to upstream Omnibus GitLab 15.1
......@@ -5,4 +5,9 @@
<% user = @options[:user] %>
<% group = @options[:groupname] %>
exec chpst -P -U <%= user %>:<%= group %> -u <%= user %>:<%= group %> /opt/gitlab/embedded/bin/redis-sentinel <%= @options[:config_path] %>
exec chpst -P \
-U <%= user %>:<%= group %> \
-u <%= user %>:<%= group %> \
/opt/gitlab/embedded/bin/redis-sentinel \
<%= @options[:config_path] %><% if node['redis']['announce_ip_from_hostname'] %> \
'--sentinel announce-ip' "$(hostname -f)"<% end %>
......@@ -7,6 +7,7 @@
let(:redis_master_password) { 'blahblahblah' }
let(:sentinel_conf) { '/var/opt/gitlab/sentinel/sentinel.conf' }
let(:redis_sv_run) { '/opt/gitlab/sv/redis/run' }
let(:sentinel_sv_run) { '/opt/gitlab/sv/sentinel/run' }
before do
allow(Gitlab).to receive(:[]).and_call_original
......@@ -68,6 +69,9 @@
expect(chef_run).to render_file(redis_sv_run).with_content { |content|
expect(content).not_to match(%r{--replica-announce-ip "\$\(hostname -f\)"})
}
expect(chef_run).to render_file(sentinel_sv_run).with_content { |content|
expect(content).not_to match(%r{'--sentinel announce-ip' "\$\(hostname -f\)"})
}
end
it_behaves_like 'enabled runit service', 'sentinel', 'root', 'root'
......@@ -109,6 +113,9 @@
expect(chef_run).to render_file(redis_sv_run).with_content { |content|
expect(content).to match(%r{--replica-announce-ip "\$\(hostname -f\)"})
}
expect(chef_run).to render_file(sentinel_sv_run).with_content { |content|
expect(content).to match(%r{'--sentinel announce-ip' "\$\(hostname -f\)"})
}
end
end
end
......
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