7e41c15581
Add the required apache modules. Add the jenkins archive key. Make sure the jenkins repo is set up and apt-get update is run before installing jenkins. Change-Id: I503705d893246300e50f3b54da6114863dc8de93
29 lines
1.3 KiB
Puppet
29 lines
1.3 KiB
Puppet
define apt::key($keyid, $ensure, $keyserver = "keyserver.ubuntu.com") {
|
|
case $ensure {
|
|
present: {
|
|
exec { "Import $keyid to apt keystore":
|
|
path => "/bin:/usr/bin",
|
|
environment => "HOME=/root",
|
|
command => "gpg --keyserver $keyserver --recv-keys $keyid && gpg --export --armor $keyid | apt-key add -",
|
|
user => "root",
|
|
group => "root",
|
|
unless => "apt-key list | grep $keyid",
|
|
logoutput => on_failure,
|
|
}
|
|
}
|
|
absent: {
|
|
exec { "Remove $keyid from apt keystore":
|
|
path => "/bin:/usr/bin",
|
|
environment => "HOME=/root",
|
|
command => "apt-key del $keyid",
|
|
user => "root",
|
|
group => "root",
|
|
onlyif => "apt-key list | grep $keyid",
|
|
}
|
|
}
|
|
default: {
|
|
fail "Invalid 'ensure' value '$ensure' for apt::key"
|
|
}
|
|
}
|
|
}
|