aboutsummaryrefslogtreecommitdiff
path: root/manifests/owner_trust.pp
diff options
context:
space:
mode:
authorMicah <micah@riseup.net>2015-10-09 20:21:58 +0000
committerMicah <micah@riseup.net>2015-10-09 20:21:58 +0000
commitba81744a42548de60bb4f48c66a7e95cd050ad4a (patch)
tree664fea7e838b553ba0864b8dc61cc5323251c4c1 /manifests/owner_trust.pp
parentf661c786095e99087773f01351cebe00837f68a7 (diff)
parent39631404dc41f706ad665ad2770e9c48b98a98fa (diff)
downloadpuppet-monkeysphere-ba81744a42548de60bb4f48c66a7e95cd050ad4a.tar.gz
puppet-monkeysphere-ba81744a42548de60bb4f48c66a7e95cd050ad4a.tar.bz2
Merge branch 'koumbit-sarava' into 'master' HEADmaster
merge the mayfirst, koumbit and sarava changes the monkeysphere module in shared is very old (2 years 4 months)! since then, sarava and koumbit have done significant work to improve on the module. mayfirst did changes to allow choosing a keyserver, added flexibility, user configs and so on. sarava fixed some bugs. koumbit merged both with the shared modules, did a style cleanup and autoloading, added RAW_AUTHORIZED_KEYS, silence some warnings and randomized cron jobs. this still fails in puppet 3.x, but is an improvement over what's already present. See merge request !1
Diffstat (limited to 'manifests/owner_trust.pp')
-rw-r--r--manifests/owner_trust.pp25
1 files changed, 25 insertions, 0 deletions
diff --git a/manifests/owner_trust.pp b/manifests/owner_trust.pp
new file mode 100644
index 0000000..0e0af7f
--- /dev/null
+++ b/manifests/owner_trust.pp
@@ -0,0 +1,25 @@
+define monkeysphere::owner_trust (
+ $fingerprint,
+ $user = 'root',
+ $level = 6 ) {
+
+ $keyserver_arg = $monkeysphere_keyserver ? {
+ '' => '',
+ default => "--keyserver $monkeysphere_keyserver"
+ }
+
+ # ensure the key is in the key ring
+ exec { "monkeysphere-gpg-recv-key-$user-$fingerprint":
+ command => "gpg $keyserver_arg --recv-key $fingerprint",
+ require => [ Package["monkeysphere"] ],
+ user => $user,
+ unless => "gpg --list-key $fingerprint 2>&1 >/dev/null"
+ }
+ # provide ownertrust
+ exec { "monkeysphere-gpg-ownertrust-$user-$fingerprint":
+ command => "printf '$fingerprint:$level\n'\$(gpg --export-ownertrust) | gpg --import-ownertrust",
+ require => [ Package["monkeysphere"] ],
+ user => $user,
+ unless => "gpg --export-ownertrust | grep $fingerprint >/dev/null"
+ }
+}