我正在尝试在Vegrant VM上自动安装Jenkins。这是我为此目的编写的Puppet文件:
class jenkins {
exec {
'jenkins download':
command => '/usr/bin/wget -q -O - http://pkg.jenkins-ci.org/debian-stable/binary/jenkins_1.565.1_all.deb',
cwd => '/tmp',
creates => '/tmp/jenkins_1.565.1_all.deb',
timeout => 0
}
package { 'jenkins install':
#provider => dpkg,
ensure => installed,
source => "/tmp/jenkins_1.565.1_all.deb",
require => [Package['memcached'], Package['openjdk-7-jdk']]
}
service {
'jenkins':
enable => true,
ensure => running,
hasrestart => true,
hasstatus => true,
require => Package['jenkins install']
}
}
但我在此过程中收到错误:
err: /Stage[main]/Jenkins/Package[jenkins install]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install jenkins install' returned 100: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: E: Unable to locate package jenkins install
==> default:
任何人都可以帮助消除此错误?
答案 0 :(得分:1)
您的基本问题是package
资源名为jenkins install
,因此Pupet会尝试管理该名称的包。这是错误的:包名为jenkins
。
您还需要将提供程序设置为dpkg
,以便Puppet不会尝试使用apt
来安装程序包。
package {
'jenkins':
ensure => 'installed',
provider => 'dpkg',
source => ...
}