From c65774204d7ab91f46f2aac243ec2650f2b39565 Mon Sep 17 00:00:00 2001 From: "Christian G. Warden" Date: Tue, 14 Feb 2012 11:40:29 -0800 Subject: [PATCH] Allow the use of the same key in multiple sources Allow the use of the same key in multiple sources by including the name of the source in the declaration for the exec which adds the key. --- manifests/source.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/source.pp b/manifests/source.pp index 2bd2e42..0512fa9 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -44,13 +44,14 @@ define apt::source( if $key != false { if $key_content { - exec { "Add key: ${key} from content": + exec { "Add key: ${key} from content for ${name}": command => "/bin/echo '${key_content}' | /usr/bin/apt-key add -", unless => "/usr/bin/apt-key list | /bin/grep '${key}'", before => File["${name}.list"], } } else { - exec { "/usr/bin/apt-key adv --keyserver ${key_server} --recv-keys ${key}": + exec { "Add key: ${key} from ${key_server} for ${name}": + command => "/usr/bin/apt-key adv --keyserver ${key_server} --recv-keys ${key}", unless => "/usr/bin/apt-key list | /bin/grep ${key}", before => File["${name}.list"], } -- 2.45.2