]> git.openstreetmap.org Git - chef.git/commitdiff
Convert cplanet to be a recipe in the planet cookbook
authorTom Hughes <tom@compton.nu>
Sat, 15 Sep 2018 11:49:50 +0000 (12:49 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 15 Sep 2018 11:51:54 +0000 (12:51 +0100)
cookbooks/cplanet/.foodcritic [deleted file]
cookbooks/cplanet/README.md [deleted file]
cookbooks/cplanet/attributes/default.rb [deleted file]
cookbooks/cplanet/metadata.rb [deleted file]
cookbooks/planet/attributes/default.rb
cookbooks/planet/recipes/current.rb [moved from cookbooks/cplanet/recipes/default.rb with 96% similarity]
cookbooks/planet/templates/default/planet-update-file.erb [moved from cookbooks/cplanet/templates/default/planet-update-file.erb with 100% similarity]
cookbooks/planet/templates/default/planet-update.cron.erb [moved from cookbooks/cplanet/templates/default/planet-update.cron.erb with 100% similarity]
cookbooks/planet/templates/default/planet-update.erb [moved from cookbooks/cplanet/templates/default/planet-update.erb with 87% similarity]
cookbooks/planet/templates/default/planet-update.logrotate.erb [moved from cookbooks/cplanet/templates/default/planet-update.logrotate.erb with 100% similarity]
roles/cplanet.rb [deleted file]

diff --git a/cookbooks/cplanet/.foodcritic b/cookbooks/cplanet/.foodcritic
deleted file mode 100644 (file)
index 0c118ec..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-~FC001
-~FC064
-~FC065
-~FC066
-~FC071
diff --git a/cookbooks/cplanet/README.md b/cookbooks/cplanet/README.md
deleted file mode 100644 (file)
index 59e2ccb..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# cplanet cookbook
-
-This cookbook installs a current planet file and keeps a local copy up-to-date.
-It is the basis for other services that need a current planet file.
-
diff --git a/cookbooks/cplanet/attributes/default.rb b/cookbooks/cplanet/attributes/default.rb
deleted file mode 100644 (file)
index e1e8c38..0000000
+++ /dev/null
@@ -1 +0,0 @@
-default[:cplanet][:jobs] = {}
diff --git a/cookbooks/cplanet/metadata.rb b/cookbooks/cplanet/metadata.rb
deleted file mode 100644 (file)
index 2ee79ff..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-name              "cplanet"
-maintainer        "OpenStreetMap Administrators"
-maintainer_email  "admins@openstreetmap.org"
-license           "Apache-2.0"
-description       "Installs and keeps current planet file"
-long_description  IO.read(File.join(File.dirname(__FILE__), "README.md"))
-version           "1.0.0"
-supports          "ubuntu"
index 649d9b399df80c498505568531b395442c285c3b..e888b56771753b07ffe0181df39dde1c45cd06a4 100644 (file)
@@ -2,3 +2,5 @@ default[:planet][:dump][:xml_directory] = "/store/planet/planet"
 default[:planet][:dump][:xml_history_directory] = "/store/planet/planet/full-history"
 default[:planet][:dump][:pbf_directory] = "/store/planet/pbf"
 default[:planet][:dump][:pbf_history_directory] = "/store/planet/pbf/full-history"
+
+default[:planet][:current][:jobs] = {}
similarity index 96%
rename from cookbooks/cplanet/recipes/default.rb
rename to cookbooks/planet/recipes/current.rb
index 1d3b6499c4606de1bf4bd3c8dbc3687589b73499..919956d891c870cdfd22efeb9205bbe33d2ac9cb 100644 (file)
@@ -1,6 +1,6 @@
 #
-# Cookbook Name:: cplanet
-# Recipe:: default
+# Cookbook Name:: planet
+# Recipe:: current
 #
 # Copyright 2018, OpenStreetMap Foundation
 #
similarity index 87%
rename from cookbooks/cplanet/templates/default/planet-update.erb
rename to cookbooks/planet/templates/default/planet-update.erb
index 683214e180eaf83fdfd0d70bfd4a7bae938010ca..d002b4fbeec40315b379e738110369ff8fd5ef7d 100644 (file)
@@ -9,7 +9,7 @@ echo "Updating planet file..."
 runuser -u planet -- /usr/local/bin/planet-update-file
 
 echo "Running jobs..."
-<% node[:cplanet][:jobs].each do |job| -%>
+<% node[:planet][:current][:jobs].each do |job| -%>
 
 echo "Running '<%= job[:command] %>' as user '<%= job[:user] %>'..."
 
diff --git a/roles/cplanet.rb b/roles/cplanet.rb
deleted file mode 100644 (file)
index 20d16cd..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-name "cplanet"
-description "Role applied to servers providing a current planet file"
-
-default_attributes(
-  :accounts => {
-    :users => {
-      :jochen => {
-        :status => :administrator
-      },
-      :cplanet => {
-        :status => :role,
-        :members => [:jochen, :tomh]
-      }
-    }
-  }
-)
-
-run_list(
-  "recipe[cplanet]"
-)