0

I'm creating a manifest to install LAMP on a CentOS 6 machine. Everything works except for installing some pear modules. When issuing puppet /etc/puppet/modules/webserver/manifests/init.pp I get the following:

Invalid package provider 'pear' at /etc/puppet/modules/webserver/manifests/init.pp:111

Here are the relevant parts of the manifest, including the order of includes at the bottom:

class php {

  package {'php':
    ensure => present,  
    before => File['/etc/php.ini'],
  }

  file {'/etc/php.ini':
    ensure => file,
  }

  $packagelist = [
    "php-cli",
    "php-common",
    "php-devel",
    "php-gd",
    "php-ldap",
    "php-mbstring",
    "php-mssql",
    "php-mysql",
    "php-pear",
    "php-pecl-ssh2",
    "php-xml"
  ]

  package { $packagelist:
    ensure => installed,
    require => Package['php'],
    notify => Service['httpd'],
  }

class pear {
  package {
     "pear":
        ensure => installed,
        provider => 'pear';
     "pecl/zip":
        ensure => installed,
        provider => 'pear';
  }
}

include php
include pear

I can comment out the include pear line at the bottom, and the rest installs without a hitch. rpm -qa | grep php-pear shows that package php-pear was successfully installed. Issuing pear at a prompt returns the expected pear help menu.

If I return to the init.pp file, and uncomment include pear and re-run puppet /etc/puppet/modules/webserver/manifests/init.pp, the same error appears.

What gives?

1

Resolved by upgrading to Puppet 2.27, then using puppet-pear module.

https://rubygems.org/gems/puppet/versions/2.7.23

https://github.com/rafaelfelix/puppet-pear

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.