From: Tom Hughes Date: Mon, 9 May 2016 19:20:41 +0000 (+0100) Subject: Disable replication on grisu X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/5a2d5b94e553234f9224472d896cf899ef4973f7?ds=sidebyside Disable replication on grisu --- diff --git a/cookbooks/planet/recipes/replication.rb b/cookbooks/planet/recipes/replication.rb index 1ae670bbb..fef4e017e 100644 --- a/cookbooks/planet/recipes/replication.rb +++ b/cookbooks/planet/recipes/replication.rb @@ -146,11 +146,17 @@ link "/var/lib/replication/day/data" do to "/store/planet/replication/day" end -template "/etc/cron.d/replication" do - source "replication.cron.erb" - owner "root" - group "root" - mode 0644 +if node[:planet][:replication] == "enabled" + template "/etc/cron.d/replication" do + source "replication.cron.erb" + owner "root" + group "root" + mode 0644 + end +else + file "/etc/cron.d/replication" do + action :delete + end end directory "/var/lib/replication/streaming" do @@ -174,9 +180,16 @@ end variables :service => name end - service name do - action [:enable, :start] - supports :restart => true, :status => true - subscribes :restart, "template[/etc/init.d/#{name}]" + if node[:planet][:replication] == "enabled" + service name do + action [:enable, :start] + supports :restart => true, :status => true + subscribes :restart, "template[/etc/init.d/#{name}]" + end + else + service name do + action [:disable, :stop] + supports :restart => true, :status => true + end end end diff --git a/roles/grisu.rb b/roles/grisu.rb index e536c0f61..613f9f27c 100644 --- a/roles/grisu.rb +++ b/roles/grisu.rb @@ -52,6 +52,9 @@ default_attributes( } } } + }, + :planet => { + :replication => "disabled" } ) diff --git a/roles/ironbelly.rb b/roles/ironbelly.rb index 0cdc647e1..bcedb6b26 100644 --- a/roles/ironbelly.rb +++ b/roles/ironbelly.rb @@ -77,6 +77,9 @@ default_attributes( } } }, + :planet => { + :replication => "enabled" + }, :rsyncd => { :modules => { :hosts => {