]> git.openstreetmap.org Git - chef.git/commitdiff
Disable replication on grisu
authorTom Hughes <tom@compton.nu>
Mon, 9 May 2016 19:20:41 +0000 (20:20 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 9 May 2016 19:20:41 +0000 (20:20 +0100)
cookbooks/planet/recipes/replication.rb
roles/grisu.rb
roles/ironbelly.rb

index 1ae670bbb1d01a812a17961bf97fa46a9377a75a..fef4e017ed51235b09ff1228b2e9a12a578649db 100644 (file)
@@ -146,11 +146,17 @@ link "/var/lib/replication/day/data" do
   to "/store/planet/replication/day"
 end
 
   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
 end
 
 directory "/var/lib/replication/streaming" do
@@ -174,9 +180,16 @@ end
     variables :service => name
   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
   end
 end
index e536c0f612a7ad6bbf29aa412d654dea471d5db2..613f9f27ca9230761a1304391fc8e545ebcc7c0a 100644 (file)
@@ -52,6 +52,9 @@ default_attributes(
         }
       }
     }
         }
       }
     }
+  },
+  :planet => {
+    :replication => "disabled"
   }
 )
 
   }
 )
 
index 0cdc647e1d4b16622b54a4f1dead9a868ccc763f..bcedb6b26aed6e39989c9d4382675c607f550874 100644 (file)
@@ -77,6 +77,9 @@ default_attributes(
       }
     }
   },
       }
     }
   },
+  :planet => {
+    :replication => "enabled"
+  },
   :rsyncd => {
     :modules => {
       :hosts => {
   :rsyncd => {
     :modules => {
       :hosts => {