X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/ba65c5618d3113373c0f3306ce993917fc2af23a..d8e4ffc098e0c3e509b4231508a44d5b0f887897:/cookbooks/dev/recipes/default.rb diff --git a/cookbooks/dev/recipes/default.rb b/cookbooks/dev/recipes/default.rb index 693abecf2..7ad5eafcb 100644 --- a/cookbooks/dev/recipes/default.rb +++ b/cookbooks/dev/recipes/default.rb @@ -28,16 +28,15 @@ include_recipe "memcached" include_recipe "munin" include_recipe "mysql" include_recipe "nodejs" +include_recipe "php::fpm" include_recipe "postgresql" include_recipe "python" package %w[ - php php-cgi php-cli php-curl php-db - php-fpm php-imagick php-mysql php-pear @@ -90,21 +89,12 @@ apache_module "wsgi" package "apache2-suexec-pristine" -service "php7.2-fpm" do - action [:enable, :start] +php_fpm "default" do + template "fpm-default.conf.erb" end -template "/etc/php/7.2/fpm/pool.d/default.conf" do - source "fpm-default.conf.erb" - owner "root" - group "root" - mode 0o644 - notifies :reload, "service[php7.2-fpm]" -end - -file "/etc/php/7.2/fpm/pool.d/www.conf" do +php_fpm "www" do action :delete - notifies :reload, "service[php7.2-fpm]" end directory "/srv/dev.openstreetmap.org" do @@ -163,13 +153,9 @@ search(:accounts, "*:*").each do |account| port = 7000 + account["uid"].to_i - template "/etc/php/7.2/fpm/pool.d/#{name}.conf" do - source "fpm.conf.erb" - owner "root" - group "root" - mode 0o644 + php_fpm name do + template "fpm.conf.erb" variables :user => name, :port => port - notifies :reload, "service[php7.2-fpm]" end ssl_certificate "#{name}.dev.openstreetmap.org" do @@ -192,9 +178,9 @@ search(:accounts, "*:*").each do |account| end end -if node[:postgresql][:clusters][:"9.5/main"] +if node[:postgresql][:clusters][:"12/main"] postgresql_user "apis" do - cluster "9.5/main" + cluster "12/main" end template "/usr/local/bin/cleanup-rails-assets" do @@ -254,12 +240,12 @@ if node[:postgresql][:clusters][:"9.5/main"] node.normal[:dev][:rails][name][:secret_key_base] = secret_key_base postgresql_database database_name do - cluster "9.5/main" + cluster "12/main" owner "apis" end postgresql_extension "#{database_name}_btree_gist" do - cluster "9.5/main" + cluster "12/main" database database_name extension "btree_gist" end @@ -301,7 +287,7 @@ if node[:postgresql][:clusters][:"9.5/main"] group "apis" repository details[:repository] revision details[:revision] - database_port node[:postgresql][:clusters][:"9.5/main"][:port] + database_port node[:postgresql][:clusters][:"12/main"][:port] database_name database_name database_username "apis" gpx_dir gpx_directory @@ -372,7 +358,7 @@ if node[:postgresql][:clusters][:"9.5/main"] group "root" mode 0o640 variables :cgimap_port => cgimap_port, - :database_port => node[:postgresql][:clusters][:"9.5/main"][:port], + :database_port => node[:postgresql][:clusters][:"12/main"][:port], :database_name => database_name, :log_directory => log_directory notifies :restart, "service[cgimap@#{name}]" @@ -436,7 +422,7 @@ if node[:postgresql][:clusters][:"9.5/main"] postgresql_database database_name do action :drop - cluster "9.5/main" + cluster "12/main" end node.normal[:dev][:rails].delete(name)