From 6a882b79db4ce5b60ee8b6182b40aeb8b94a7776 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 8 Oct 2017 17:32:31 +0100 Subject: [PATCH] Make keys file nicer --- modules/yaourt/manifests/keys.pp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/modules/yaourt/manifests/keys.pp b/modules/yaourt/manifests/keys.pp index 18fdab4..bd918cc 100644 --- a/modules/yaourt/manifests/keys.pp +++ b/modules/yaourt/manifests/keys.pp @@ -1,15 +1,22 @@ class yaourt::keys () { - exec { 'gpg --recv-keys F7E48EDB': - user => 'jake' - } + $keys = [ + "8A8F901A", # Sublime Text + "D1483FA6C3C07136" # Tor Browser + ] - exec { 'pacman-key -r 962DDE58': - } - - exec { 'pacman-key --lsign-key 962DDE58': - } - - exec { 'gpg --keyserver pool.sks-keyservers.net --recv-keys 2E1AC68ED40814E0': - user => 'jake' + $keys.each |$key| { + exec { "gpg --recv-keys $key": + user => 'jake', + unless => "gpg --list-keys $key" + } + exec { "add $key for root": # So root can install things + command => "gpg --recv-keys $key", + unless => "gpg --list-keys $key" + } + exec { "pacman-key -r $key": + unless => "pacman-key --list-keys $key" + } + exec { "pacman-key --lsign-key $key": + } } }