从puppet安装时PHP扩展依赖性问题

时间:2013-05-26 12:52:19

标签: php debian vagrant puppet

有谁知道如何解决php扩展的依赖问题?

default.pp

class { 'php':
  package => 'php5',
  service => 'apache',
  version => '5.2.10.dfsg.1-2ubuntu6.5',
  require => Package['apache'],
}

package { "PhpModule_mhash":
  ensure   => '5.2.10.dfsg.1-2ubuntu6.5',
  name     => 'php5-mhash',
  require  => [Package['php'], Package['PhpModule_common'], ],
}

当我vagrant up我收到err

err: /Stage[main]//Package[PhpModule_mhash]/ensure: change from purged to 5.2.10.dfsg.1-2ubuntu6.5 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install php5-mhash=5.2.10.dfsg.1-2ubuntu6.5' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
php5-mhash : Depends: php5 but it is not going to be installed or
                   phpapi-20060613+lfs
E: Unable to correct problems, you have held broken packages.
at /tmp/vagrant-puppet/manifests/default.pp:79

我的虚拟盒存储库是最新的,并且所有必需的包都可用。安装PHP也没有问题。

当我vagrant ssh并执行以下命令时,非常有趣的事实是:

/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install php5-mhash=5.2.10.dfsg.1-2ubuntu6.5

它的安装没有任何通知......

  1. 有没有办法告诉Package已经安装了php5?
  2. 如果我已经需要包,有没有办法省略依赖项?
  3. 我在Puppet或Debian方面有哪些选择?
  4. 提前致谢

1 个答案:

答案 0 :(得分:0)

Puppet Chaining就是答案!

即使我已经指定* PhpModule_mhash * package`requires php 类,我必须在我的清单中插入链接。

Class['php'] -> Package['PhpModule_common'] -> Package['PhpModule_cli'] -> Package['PhpModule_mhash']