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

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

Open KlavsKlavsen opened this issue 7 years ago • 3 comments

  • Puppet: 4.10
  • Ruby: (builtin in puppet-agent)
  • Distribution: Ubuntu 16.04
  • Module version: latest from github as of today

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 avatar Jul 06 '17 08:07 KlavsKlavsen

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 avatar Jul 06 '17 08:07 KlavsKlavsen

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

KlavsKlavsen avatar Jul 06 '17 08:07 KlavsKlavsen

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

KlavsKlavsen avatar Oct 09 '17 06:10 KlavsKlavsen