aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2010-11-21 17:19:59 +0000
committerMichael Scherer <misc@mageia.org>2010-11-21 17:19:59 +0000
commit3330fbab993e2190d9f85629b71d78c3f9020789 (patch)
tree2b670c01fe500b2ba93a6de3236d8cc88580c392 /modules
parent1588ae5065c48b212a3a0f1bc80ea3044e92cfc7 (diff)
downloadpuppet-3330fbab993e2190d9f85629b71d78c3f9020789.tar
puppet-3330fbab993e2190d9f85629b71d78c3f9020789.tar.gz
puppet-3330fbab993e2190d9f85629b71d78c3f9020789.tar.bz2
puppet-3330fbab993e2190d9f85629b71d78c3f9020789.tar.xz
puppet-3330fbab993e2190d9f85629b71d78c3f9020789.zip
- add a class to generate self signed certificate ( as we may likely
need it elsewhere )
Diffstat (limited to 'modules')
-rw-r--r--modules/openssl/manifests/init.pp12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/openssl/manifests/init.pp b/modules/openssl/manifests/init.pp
new file mode 100644
index 00000000..fb1f9239
--- /dev/null
+++ b/modules/openssl/manifests/init.pp
@@ -0,0 +1,12 @@
+class openssl {
+ define self_signed_cert($directory = '/etc/certs') {
+ package { 'openssl':
+ ensure => installed
+ }
+ $pem_file = "$name.pem"
+ exec { "openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $pem_file -out $pem_file -subj '/CN=$name.$domain'":
+ cwd => "$directory",
+ creates => "$directory/$name.pem"
+ }
+ }
+}