我正在创建一个清单以在 CentOS 6 机器上安装 LAMP。除了安装一些梨模块外,一切正常。发行时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
,则会出现相同的错误。
是什么赋予了?
通过升级到 Puppet 2.27,然后使用 puppet-pear 模块解决。
https://rubygems.org/gems/puppet/versions/2.7.23
https://github.com/rafaelfelix/puppet-pear