]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/gps-tile/recipes/default.rb
Use multipackage installs throughout
[chef.git] / cookbooks / gps-tile / recipes / default.rb
index 87c2c49ac92a3bb4a916279c4b3094e57db3a12d..315865ac924cb7073fa4ebf534a12ebfae39d490 100644 (file)
 # limitations under the License.
 #
 
-include_recipe "apache::ssl"
+include_recipe "apache"
 
-package "make"
-package "build-essential"
-package "pkg-config"
-package "zlib1g-dev"
-package "libbz2-dev"
-package "libarchive-dev"
-package "libexpat1-dev"
-package "libpng-dev"
-package "pngquant"
-package "libcache-memcached-perl"
+package %w[
+  make
+  build-essential
+  pkg-config
+  zlib1g-dev
+  libbz2-dev
+  libarchive-dev
+  libexpat1-dev
+  libpng-dev
+  pngquant
+  libcache-memcached-perl
+]
 
 directory "/srv/gps-tile.openstreetmap.org" do
   owner "gpstile"
@@ -78,17 +80,25 @@ git "/srv/gps-tile.openstreetmap.org/updater" do
   group "gpstile"
 end
 
-template "/etc/init.d/gps-update" do
-  source "update.init.erb"
-  owner "root"
-  group "root"
-  mode 0o755
+systemd_service "gps-update" do
+  description "GPS tile update daemon"
+  after ["network.target", "memcached.service"]
+  wants ["memcached.service"]
+  user "gpstile"
+  working_directory "/srv/gps-tile.openstreetmap.org"
+  exec_start "/srv/gps-tile.openstreetmap.org/updater/update"
+  private_tmp true
+  private_devices true
+  protect_system "full"
+  protect_home true
+  no_new_privileges true
+  restart "on-failure"
 end
 
 service "gps-update" do
   action [:enable, :start]
-  supports :restart => true, :status => true
   subscribes :restart, "git[/srv/gps-tile.openstreetmap.org/updater]"
+  subscribes :restart, "systemd_service[gps-update]"
 end
 
 remote_directory "/srv/gps-tile.openstreetmap.org/html" do