]> git.openstreetmap.org Git - chef.git/commitdiff
Allow PHP configuration options for FPM to be configured
authorTom Hughes <tom@compton.nu>
Sun, 12 Jul 2020 18:40:10 +0000 (19:40 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 12 Jul 2020 18:54:48 +0000 (19:54 +0100)
cookbooks/php/attributes/default.rb
cookbooks/php/recipes/fpm.rb
cookbooks/php/templates/default/php-fpm.ini.erb [new file with mode: 0644]

index 0ca636813b10d67d962662ce0b06f1b688882683..ccce260930be9ef6775deeb573fc2c92ccfa36f4 100644 (file)
@@ -3,3 +3,5 @@ default[:php][:version] = if node[:lsb][:release].to_f < 20.04
                           else
                             "7.4"
                           end
+
+default[:php][:fpm][:options] = {}
index 9932bcdcfd1acd808724ce8f45f8156a9073b2b1..be90a67833cf3e73f4fad041bdb0ee9c78a4a323 100644 (file)
@@ -22,6 +22,13 @@ include_recipe "php"
 
 package "php-fpm"
 
+template "/etc/php/#{node[:php][:version]}/fpm/conf.d/99-chef.ini" do
+  source "php-fpm.ini.erb"
+  owner "root"
+  group "root"
+  mode 0o644
+end
+
 service "php#{node[:php][:version]}-fpm" do
   action [:enable, :start]
 end
diff --git a/cookbooks/php/templates/default/php-fpm.ini.erb b/cookbooks/php/templates/default/php-fpm.ini.erb
new file mode 100644 (file)
index 0000000..da34ca3
--- /dev/null
@@ -0,0 +1,5 @@
+; DO NOT EDIT - This file is being maintained by Chef
+
+<% node[:php][:fpm][:options].sort.each do |key,value| -%>
+<%= key %>=<%= value %>
+<% end -%>