Php

無效的包提供程序’pear'

  • September 4, 2013

我正在創建一個清單以在 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

引用自:https://serverfault.com/questions/536327