puppet-php
puppet-php copied to clipboard
php settings are overwritten by system defaults
Affected Puppet, Ruby, OS and module versions/distributions
- Puppet: 3.8
- Ruby: 2.3.1
- Distribution: Ubuntu Xenial 16.04
- Module version: v4.0.0
How to reproduce (e.g Puppet code you use)
class { '::php':
...
settings => { 'expose_php' => 'Off' },
}
What are you seeing
# /etc/php# grep -rn expose_php .
./7.0/cli/php.ini:7:expose_php = Off
./7.0/cli/php.ini:380:expose_php = On
php module adds the config lines at the top of the file. but then the already existing setting on line 380 in this case has precedence.
the same goes for the fpm/php.ini
file.
What behaviour did you expect instead
the module should add setting on the bottom or replace existing lines, but this just solves the problem partly, as some modules also have config in their conf.d/22-<module>.ini
file.
an other approach would be to put all puppet managed settings into a file in /etc/php/7.0/cli/conf.d/999-php.ini
for example. Then those setting will overwrite the ones from ../cli/php.ini
and come after any file in conf.d
.
this can currently be done by having this in hiera:
php::cli::inifile: '/etc/php/7.0/cli/conf.d/999-php.ini'
php::fpm::inifile: '/etc/php/7.0/fpm/conf.d/999-php.ini'
for me, it would be totally fine if we could expose thoses two parameters so it can be set when calling class { '::php': }
actually I think those default file paths could go into params.pp
According to the documentation the settings must be in a INI section. https://github.com/voxpupuli/puppet-php#defining-phpini-settings
If you prefix your setting with 'PHP/' it will work as expected.