camptocamp/puppet-apt — Issue #7: fetching key from keyserver is broken
Author: copton
Created: 2011-11-07 15:31:33+00:00
State: open

Hey,

when fetching the key from a keyserver, apt-key is executed twice.

Here is a small patch that fixes this:
---8<---
--- a/modules/apt/manifests/definitions/key.pp
+++ b/modules/apt/manifests/definitions/key.pp
@@ -5,7 +5,7 @@ define apt::key($ensure=present, $source="", $content="") {
present: {
if $content == "" {
if $source == "" {
- $thekey = "gpg --keyserver pgp.mit.edu --recv-key '$name' && gpg --export --armor '$name' | /usr/bin/apt-key add -"
+ $thekey = "gpg --keyserver pgp.mit.edu --recv-key '$name' && gpg --export --armor '$name'"
}
else {
$thekey = "wget -O - '$source'"
--->8---

Note that apt-key is executed later via
---8<---
command => "${thekey} | /usr/bin/apt-key add -",
--->8---

greetings

copton