无效的软件包提供商‘pear’

无效的软件包提供商‘pear’

我正在创建清单以在 CentOS 6 机器上安装 LAMP。除了安装一些 pear 模块外,一切正常。发布时puppet /etc/puppet/modules/webserver/manifests/init.pp我收到以下内容:

/etc/puppet/modules/webserver/manifests/init.pp:111 上的软件包提供程序“pear”无效

以下是清单的相关部分,包括底部的包含顺序:

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

我可以注释掉include pear底部的行,其余部分就可以顺利安装。 rpm -qa | grep php-pear显示软件包 php-pear 已成功安装。pear在提示符下发出命令将返回预期的 pear 帮助菜单。

如果我返回到 init.pp 文件,取消注释include pear并重新运行puppet /etc/puppet/modules/webserver/manifests/init.pp,则会出现相同的错误。

是什么赋予了?

答案1

通过升级到 Puppet 2.27,然后使用 puppet-pear 模块来解决。

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

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

相关内容