]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/piwik/recipes/default.rb
Update piwik configuration
[chef.git] / cookbooks / piwik / recipes / default.rb
index a6b2bf3a7aa283572478fb49398dabcfed52f886..948c03af41b00fa964131bc8af9afcde536a926e 100644 (file)
 include_recipe "apache"
 include_recipe "geoipupdate"
 include_recipe "mysql"
+include_recipe "php::apache"
 
 passwords = data_bag_item("piwik", "passwords")
 
-package "php"
-package "php-cli"
-package "php-curl"
-package "php-mbstring"
-package "php-mysql"
-package "php-gd"
-package "php-xml"
-package "php-apcu"
+package %w[
+  php-cli
+  php-curl
+  php-mbstring
+  php-mysql
+  php-gd
+  php-xml
+  php-apcu
+  unzip
+]
 
 apache_module "expires"
-apache_module "php7.2"
 apache_module "rewrite"
 
 version = node[:piwik][:version]
@@ -121,9 +123,8 @@ apache_site "piwik.openstreetmap.org" do
   template "apache.erb"
 end
 
-template "/etc/cron.d/piwiki" do
-  source "cron.erb"
-  owner "root"
-  group "root"
-  mode "0644"
+cron_d "piwik" do
+  minute "5"
+  user "www-data"
+  command "/usr/bin/php /srv/piwik.openstreetmap.org/console core:archive --quiet --url=https://piwik.openstreetmap.org/"
 end