voxpupuli / puppet-php

Generic Puppet module to manage PHP on many platforms
http://forge.puppet.com/puppet/php
MIT License
87 stars 268 forks source link

modules not enabled for ALL, if its already enabled for cli only #362

Open KlavsKlavsen opened 7 years ago

KlavsKlavsen commented 7 years ago

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

$_extensions_defaults = { bcmath => { }, curl => { }, soap => { }, mbstring => { }, mcrypt => { }, mysql => { so_name => 'mysqli' }, memcached => { package_prefix => 'php-', }, zip => { }, imagick => { package_prefix => 'php-', }, xmlrpc => { }, apcu => { package_prefix => 'php-', sapi => 'fpm', }, }

class { '::php': manage_repos => false, fpm => true, fpm_pools => { 'www' => {} }, dev => false, package_prefix =>'php7.0-', composer => false, settings => { 'PHP/max_execution_time' => '90', 'PHP/max_input_time' => '300', 'PHP/memory_limit' => $memory_limit, 'PHP/post_max_size' => '32M', 'PHP/upload_max_filesize' => '32M', 'Date/date.timezone' => 'Europe/Copenhagen', }, extensions => $_extensions_defaults, }

What are you seeing

/etc/php/7.0/cli/conf.d | grep curl <-- its there /etc/php/7.0/fpm/conf.d | grep curl <-- its NOT there

What behaviour did you expect instead

that puppet would notice the module was NOT enabled for ALL (and only for cli).

I fixed it by running: phpdismod curl and then it runs: /usr/sbin/phpenmod -v 7.0 -s ALL curl

KlavsKlavsen commented 7 years ago

I can see (from puppet debug output) that voxpopuli-php uses this check to see if module is enabled: /usr/sbin/phpquery -v 7.0 -s cli -m curl

which results in the above problem. It should check for ALL that it should be enabled for. (cli, fpm.. and what is apache one called on ubuntu?)

Perhaps by having a fact detect available options, by doing: ls /etc/php/7.0/ | grep -v "mods-available" (on my system that renders: cli fpm )

KlavsKlavsen commented 7 years ago

I'd propose to run: /usr/sbin/phpquery -v 7.0 -S - to get list of available sapi's on system.

KlavsKlavsen commented 7 years ago

@chrisboulton Thank you for taking the time to create a patch.. I never got around to it :(