From 891aa0fbbed87e24322da7d3a80514f1bf94f0ac Mon Sep 17 00:00:00 2001 From: Antoine Beaupré Date: Thu, 11 Jun 2015 10:21:56 -0400 Subject: allow for binary keys that can be removed --- manifests/key/plain.pp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 manifests/key/plain.pp (limited to 'manifests/key/plain.pp') diff --git a/manifests/key/plain.pp b/manifests/key/plain.pp new file mode 100644 index 0000000..a84e6dd --- /dev/null +++ b/manifests/key/plain.pp @@ -0,0 +1,13 @@ +define apt::key::plain ($source) { + file { + "${apt::apt_base_dir}/${name}": + source => $source; + "${apt::apt_base_dir}/keys": + ensure => directory; + } + exec { "apt-key add ${apt::apt_base_dir}/${name}": + subscribe => File["${apt::apt_base_dir}/${name}"], + refreshonly => true, + notify => Exec['refresh_apt'], + } +} -- cgit v1.2.3 From 5564b3fba3d8aebdc3cbcd7441e9c7a216243f46 Mon Sep 17 00:00:00 2001 From: Antoine Beaupré Date: Wed, 26 Aug 2015 23:27:58 -0400 Subject: fix install location of apt::key::plain --- manifests/key/plain.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests/key/plain.pp') diff --git a/manifests/key/plain.pp b/manifests/key/plain.pp index a84e6dd..a24a51b 100644 --- a/manifests/key/plain.pp +++ b/manifests/key/plain.pp @@ -1,12 +1,12 @@ define apt::key::plain ($source) { file { - "${apt::apt_base_dir}/${name}": + "${apt::apt_base_dir}/keys/${name}": source => $source; "${apt::apt_base_dir}/keys": ensure => directory; } - exec { "apt-key add ${apt::apt_base_dir}/${name}": - subscribe => File["${apt::apt_base_dir}/${name}"], + exec { "apt-key add ${apt::apt_base_dir}/keys/${name}": + subscribe => File["${apt::apt_base_dir}/keys/${name}"], refreshonly => true, notify => Exec['refresh_apt'], } -- cgit v1.2.3 From 8745de17d64a6eac0eb9f15c19f990fd80383c1f Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 31 Aug 2015 09:55:17 +0000 Subject: Quote apt-key variable parameter. This is not perfect protection against special chars that the shell may interpret, but should help at least in case $name contains spaces. --- manifests/key/plain.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/key/plain.pp') diff --git a/manifests/key/plain.pp b/manifests/key/plain.pp index a24a51b..e4a2f89 100644 --- a/manifests/key/plain.pp +++ b/manifests/key/plain.pp @@ -5,7 +5,7 @@ define apt::key::plain ($source) { "${apt::apt_base_dir}/keys": ensure => directory; } - exec { "apt-key add ${apt::apt_base_dir}/keys/${name}": + exec { "apt-key add '${apt::apt_base_dir}/keys/${name}'": subscribe => File["${apt::apt_base_dir}/keys/${name}"], refreshonly => true, notify => Exec['refresh_apt'], -- cgit v1.2.3