aboutsummaryrefslogtreecommitdiffstats
path: root/modules/gnupg/manifests/keys.pp
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2012-03-19 17:11:39 +0000
committerMichael Scherer <misc@mageia.org>2012-03-19 17:11:39 +0000
commit79a0ef03872196d78bddaec3d7b657dd288a4ab4 (patch)
treea452749dd7313855c71fe09bfa9b0fa247cd0e25 /modules/gnupg/manifests/keys.pp
parent77423467c387b1ca0e0c5aa85a9bdd52e3372bb7 (diff)
downloadpuppet-79a0ef03872196d78bddaec3d7b657dd288a4ab4.tar
puppet-79a0ef03872196d78bddaec3d7b657dd288a4ab4.tar.gz
puppet-79a0ef03872196d78bddaec3d7b657dd288a4ab4.tar.bz2
puppet-79a0ef03872196d78bddaec3d7b657dd288a4ab4.tar.xz
puppet-79a0ef03872196d78bddaec3d7b657dd288a4ab4.zip
split gnupg::keys in a separate file
Diffstat (limited to 'modules/gnupg/manifests/keys.pp')
-rw-r--r--modules/gnupg/manifests/keys.pp38
1 files changed, 38 insertions, 0 deletions
diff --git a/modules/gnupg/manifests/keys.pp b/modules/gnupg/manifests/keys.pp
new file mode 100644
index 00000000..ec45de87
--- /dev/null
+++ b/modules/gnupg/manifests/keys.pp
@@ -0,0 +1,38 @@
+ # debian recommend SHA2, with 4096
+ # http://wiki.debian.org/Keysigning
+ # as they are heavy users of gpg, I will tend
+ # to follow them
+ # however, for testing purpose, 4096 is too strong,
+ # this empty the entropy of my vm
+class gnupg::keys($email,
+ $key_name,
+ $key_type = 'RSA',
+ $key_length = '4096',
+ $expire_date = '400d',
+ $login = 'signbot',
+ $batchdir = '/var/lib/signbot/batches',
+ $keydir = '/var/lib/signbot/keys') {
+
+ include gnupg::client
+ file { "$name.batch":
+ path => "$batchdir/$name.batch",
+ content => template('gnupg/batch')
+ }
+
+ file { $keydir:
+ ensure => directory,
+ owner => $login,
+ mode => '0700',
+ }
+
+ file { $batchdir:
+ ensure => directory,
+ owner => $login,
+ }
+
+ exec { "/usr/local/bin/create_gnupg_keys.sh $batchdir/$name.batch $keydir $batchdir/$name.done":
+ user => $login,
+ creates => "$batchdir/$name.done",
+ require => [File[$keydir], File["$batchdir/$name.batch"], Package['rng-utils']],
+ }
+}