aboutsummaryrefslogtreecommitdiffstats
path: root/modules/gnupg/templates
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2011-01-17 15:24:10 +0000
committerMichael Scherer <misc@mageia.org>2011-01-17 15:24:10 +0000
commit3a5183a2f2a583c7982215e60a6779ef72e72f35 (patch)
treeee71a2497f32ead41dc6814b00f3cf1b99eb9e6c /modules/gnupg/templates
parent2256d3a476f4ee7e16d6e094fd4873a9d6756013 (diff)
downloadpuppet-3a5183a2f2a583c7982215e60a6779ef72e72f35.tar
puppet-3a5183a2f2a583c7982215e60a6779ef72e72f35.tar.gz
puppet-3a5183a2f2a583c7982215e60a6779ef72e72f35.tar.bz2
puppet-3a5183a2f2a583c7982215e60a6779ef72e72f35.tar.xz
puppet-3a5183a2f2a583c7982215e60a6779ef72e72f35.zip
- add a module to generate gnupg key ( similar to the one for openssl
certs )
Diffstat (limited to 'modules/gnupg/templates')
-rw-r--r--modules/gnupg/templates/batch12
-rw-r--r--modules/gnupg/templates/create_gnupg_keys.sh13
2 files changed, 25 insertions, 0 deletions
diff --git a/modules/gnupg/templates/batch b/modules/gnupg/templates/batch
new file mode 100644
index 00000000..05ffe095
--- /dev/null
+++ b/modules/gnupg/templates/batch
@@ -0,0 +1,12 @@
+%echo Generating a standard key
+Key-Type: <%= key_type %>
+Key-Length: <%= key_length %>
+Name-Real: <%= key_name %>
+Name-Comment: Key made by puppet on <%= fqdn %>
+Name-Email: <%= email %>
+Expire-Date: <%= expire_date %>
+%pubring <%= name %>.pub
+%secring <%= name %>.sec
+%commit
+%echo done
+
diff --git a/modules/gnupg/templates/create_gnupg_keys.sh b/modules/gnupg/templates/create_gnupg_keys.sh
new file mode 100644
index 00000000..fbb41277
--- /dev/null
+++ b/modules/gnupg/templates/create_gnupg_keys.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+NAME=$1
+
+/sbin/rngd -f -r /dev/urandom &
+RAND=$!
+cd /etc/gnupg/keys/
+gpg --homedir /etc/gnupg/keys/ --batch --gen-key /etc/gnupg/batches/$NAME.batch
+EXIT=$?
+
+kill $RAND
+
+exit $EXIT