木偶需要function不做我想要的节点定义
我正在使用Vagrant的Puppet(版本2.7.19)为项目设置开发框。 我有我需要的所有依赖关系的Puppet类,但是对于我的Vagrant框,我需要首先运行apt-get更新。 我把这个逻辑包装在一个名为“vagrant :: bootstrap”的类中。 因为我想让我的其他类尽可能地保持“中性”,所以我在site.pp中写了下面的节点定义,这样我的Vagrant特定的需求就不会污染其他机器的configuration。 node default { require vagrant::bootstrap include base, puppet::agent, php::php54, apache2 } class apache2 { include apache2::install, apache2::service } class apache2::install { package { [ "apache2", "apache2-doc", "apache2-mpm-worker", "apache2-utils", "libapache2-mod-fcgid" ]: ensure => present } } 所有的模块被正确加载据我可以告诉,但是我看到木偶试图apt-get更新运行完成之前安装apache2 err: /Stage[main]/Apache2::Install/Package[apache2-utils]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y […]