我正在尝试创建自动安装 zend 服务器 CE 的 puppet 模块,这在这里并不重要,但步骤如下
- 更新 /etc/apt/source.list
- 通过 wget 下载 repos 密钥
- 做apt-get更新
- 做 apt-get install zend-server-ce-5.2
我有init.pp
档案
class zendserverce {
# https://github.com/puppetlabs/puppetlabs-stdlib
file_line { 'debian_package':
path => '/etc/apt/sources.list',
line => 'deb http://repos.zend.com/zend-server/deb server non-free'
}
exec { "wget http://repos.zend.com/zend.key -O- |apt-key add -":
path => ["/usr/bin", "/usr/sbin"]
}
exec { "apt-get update":
command => "/usr/bin/apt-get update",
onlyif => "/bin/sh -c '[ ! -f /var/cache/apt/pkgcache.bin ] || /usr/bin/find /etc/apt/* -cnewer /var/cache/apt/pkgcache.bin | /bin/grep . > /dev/null'",
}
package { "zend-server-ce-php-5.2":
ensure => "latest"
}
}
似乎 puppet 以不同的顺序运行命令,然后我需要。有什么办法可以告诉他按照我想要的顺序运行?
这种片段的输出是
[0;36mnotice: /Stage[main]/Mc/Package[mc]/ensure: ensure changed 'purged' to 'latest'[0m
[1;35merr: /Stage[main]/Zendserverce/Package[zend-server-ce-php-5.2]/ensure: change from purged to latest failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install zend-server-ce-php-5.2' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Couldn't find package zend-server-ce-php-5.2 at /tmp/vagrant-puppet/modules 0/zendserverce/manifests/init.pp:28[0m
[0;36mnotice: /Stage[main]/Zendserverce/Exec[wget http://repos.zend.com/zend.key -O- |apt-key add -]/returns: executed successfully[0m
[0;36mnotice: /Stage[main]/Zendserverce/File_line[debian_package]/ensure: created[0m
[0;36mnotice: Finished catalog run in 6.75 seconds[0m
所以它说:找不到包zend-server-ce-php-5.2
谁能指导我出了什么问题?