puppet-php icon indicating copy to clipboard operation
puppet-php copied to clipboard

fpm_global_pool_settings => { 'listen' => '/var/run/some.sock',} is ignored / overwritten

Open dspolleke opened this issue 5 years ago • 1 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.10
  • Ruby:
  • Distribution: RHEL 7.6
  • Module version: 6.0.2 / 7.0.0

How to reproduce (e.g Puppet code you use)

if you use a socket to connect to php-fpm and set the defaults in

fpm_global_pool_settings => {
  'listen' => '/var/run/some.sock',
}

and you upgrade from 6.0.2 to 7.0.0 it will overwrite the settings in fpm_global_pool_settings with the defaults in the default.yaml

What are you seeing

Notice: /Stage[main]/Php::Fpm/Php::Fpm::Pool[www]/File[/etc/opt/rh/rh-php72//php-fpm.d/www.conf]/content:
--- /etc/opt/rh/rh-php72/php-fpm.d/www.conf     2020-01-21 13:54:31.818782603 +0100
+++ /tmp/puppet-file20200205-9085-znd67w        2020-02-05 10:22:52.995369711 +0100
@@ -1,7 +1,7 @@
 [www]

 ; The address on which to accept FastCGI requests.
-listen = /var/run/php72.sock
+listen = 127.0.0.1:9000

 ; Set listen(2) backlog. A value of '-1' means unlimited.
 listen.backlog = -1

Notice: /Stage[main]/Php::Fpm/Php::Fpm::Pool[www]/File[/etc/opt/rh/rh-php72//php-fpm.d/www.conf]/content: content changed '{md5}0ccfda225d8899728ac42b0682259322' to '{m
d5}6864a58ec8f4f3d83945ef8a8ea3706b'

This will result in a not working Apache / PHP7 installation. (503 in the browser)

What behaviour did you expect instead

A working php-fpm like in version 6.02

Output log

see above

Any additional information you'd like to impart

we use the rh-scl version of php 7.2

dspolleke avatar Feb 05 '20 09:02 dspolleke

I can confirm the problem as it caught us off-guard causing downtime :/

Commit 5d21b37a0617508c33fd4fd7c89f87c0ae4f2dea changed this area of the code and we now have to pass an empty hash for the default 'www' pool for the fpm_global_pool_settings to apply. Here's an example for Ubuntu 18.04:

class { 'php':
    fpm_pools                => {
      'www' => {},
    },
    fpm_global_pool_settings => {
      'listen' => '/var/run/php/php7.2-fpm.sock',
      ....
    },
}

simondeziel avatar Sep 01 '20 17:09 simondeziel