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

package { 'php': } in init.pp breaks apt-get on Ubuntu if install_options is left blank

Open jwbraucher opened this issue 10 years ago • 1 comments

Hello - great module, by the way.

I've been testing a deployment on an Ubuntu 14.04 system using the latest commit of this module (March, 2015) and I keep encountering the same error when the module tries to install php5. The error is :

Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold  install php5' returned 100: E: Invalid operation

I've discovered that this is caused by passing an empty value to 'install_options' in the package declaration for php in site.pp (the default behavior):

 ### Managed resources
package { 'php':
ensure => $php::manage_package,
name => $php::package,
install_options => $php::install_options,
}

This passes an invalid null argument to 'apt-get install'. I've worked around this by passing "-y" in to the install_options parameter. I'm not sure what the correct solution is, but it would appear that at least on Ubuntu 14.04 the install_options parameter does not work with an empty value.

jwbraucher avatar Mar 13 '15 21:03 jwbraucher

good points, ty, this should be managed in the params class, pr welcomed

alvagante avatar Mar 15 '15 21:03 alvagante