aboutsummaryrefslogtreecommitdiffstats
path: root/modules/gnupg
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gnupg')
-rw-r--r--modules/gnupg/manifests/client.pp8
-rw-r--r--modules/gnupg/manifests/keys.pp12
-rw-r--r--modules/gnupg/templates/batch11
3 files changed, 18 insertions, 13 deletions
diff --git a/modules/gnupg/manifests/client.pp b/modules/gnupg/manifests/client.pp
index a032b323..301e569a 100644
--- a/modules/gnupg/manifests/client.pp
+++ b/modules/gnupg/manifests/client.pp
@@ -1,9 +1,15 @@
class gnupg::client {
+if versioncmp($::lsbdistrelease, '7') < 0 {
package {['gnupg',
'rng-utils']:
}
+} else {
+ package {['gnupg2',
+ 'rng-utils']:
+ }
+}
- mga-common::local_script { 'create_gnupg_keys.sh':
+ mga_common::local_script { 'create_gnupg_keys.sh':
content => template('gnupg/create_gnupg_keys.sh')
}
}
diff --git a/modules/gnupg/manifests/keys.pp b/modules/gnupg/manifests/keys.pp
index 948619a2..b99ed393 100644
--- a/modules/gnupg/manifests/keys.pp
+++ b/modules/gnupg/manifests/keys.pp
@@ -1,5 +1,5 @@
# debian recommend SHA2, with 4096
- # http://wiki.debian.org/Keysigning
+ # https://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,
@@ -14,8 +14,8 @@ define gnupg::keys($email,
$keydir = '/var/lib/signbot/keys') {
include gnupg::client
- file { "$name.batch":
- path => "$batchdir/$name.batch",
+ file { "${name}.batch":
+ path => "${batchdir}/${name}.batch",
content => template('gnupg/batch')
}
@@ -30,9 +30,9 @@ define gnupg::keys($email,
owner => $login,
}
- exec { "/usr/local/bin/create_gnupg_keys.sh $batchdir/$name.batch $keydir $batchdir/$name.done":
+ 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']],
+ creates => "${batchdir}/${name}.done",
+ require => [File[$keydir], File["${batchdir}/${name}.batch"], Package['rng-utils']],
}
}
diff --git a/modules/gnupg/templates/batch b/modules/gnupg/templates/batch
index 4dff44eb..d55bdd52 100644
--- a/modules/gnupg/templates/batch
+++ b/modules/gnupg/templates/batch
@@ -1,9 +1,8 @@
%echo Generating a standard key
-Key-Type: <%= key_type %>
-Key-Length: <%= key_length %>
-Name-Real: <%= key_name %>
-Name-Email: <%= email %>
-Expire-Date: <%= expire_date %>
+Key-Type: <%= @key_type %>
+Key-Length: <%= @key_length %>
+Name-Real: <%= @key_name %>
+Name-Email: <%= @email %>
+Expire-Date: <%= @expire_date %>
%commit
%echo done
-