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

Error: Could not run: Command pear is missing #340

Open walkamongus opened 7 years ago

walkamongus commented 7 years ago

Affected Puppet, Ruby, OS and module versions/distributions

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

~]# puppet resource package <PACKAGE>

What are you seeing

~]# puppet resource package vim
Error: Could not run: Command pear is missing

What behaviour did you expect instead

~]# puppet resource package vim
package { 'vim':
  ensure => '<SOME_VERSION>',
}

Any additional information you'd like to impart

I think the pear provider needs something along the lines of https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/yum.rb#L16-L24 to confine it to systems where the command actually exists.

walkamongus commented 7 years ago

I tracked down this issue to the pecl provider calling super in its instances method to pass the call up to it's parent pear. The pear provider includes a commands method call to confine the provider to nodes that have this command available. The problem is that the pecl provider does not contain a call to commands and thus fires even if the pear command isn't available.

Adding this to the pecl provider immediately resolves the issue.