php5enmod mcrypt with Puppet php5enmod mcrypt with Puppet nginx nginx

php5enmod mcrypt with Puppet


It appears the correct way to do this (As referenced @BMW's comment) is to ensure that Puppet knows where the "find" command is before attempting to execute php5enmod.

My puppet configuration is below:

# Ensure Mcrypt is enabledexec { "enablemcrypt":  path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ],  command => "php5enmod mcrypt",  notify => Service["apache2"],  require => Package["php5-common"],}

As you can see, by adding "/bin", "/sbin", "/usr/bin" and "/usr/sbin" to the path parameter, puppet can now use the "find" command, which it seems to use internally when executing commands with arguments. php5enmod now runs correctly for me on Ubuntu 14.04 LTS.


Unfortunately, I wasn't able to get this to work as I would have liked. I'm unsure if Puppet is just not playing nicely with php5enmod, or whether there's some internal issues with php5enmod and the way it's being called by the Puppet scripts.

However, I did manage to manually create the symbolic link and restart the service with the following block of code.

file { '/etc/php5/fpm/conf.d/20-mcrypt.ini':    ensure => 'link',    target => '/etc/php5/mods-available/mcrypt.ini',    require => [        Package['php5-mcrypt'],        Package['php5-fpm'],    ],    notify => Service['php5-fpm'],}

Hopefully this helps somebody out in the future.