[Mageia-sysadm] [345] - add a class to generate self signed certificate ( as we may likely

root at mageia.org root at mageia.org
Sun Nov 21 18:19:59 CET 2010


Revision: 345
Author:   misc
Date:     2010-11-21 18:19:59 +0100 (Sun, 21 Nov 2010)
Log Message:
-----------
- add a class to generate self signed certificate ( as we may likely
  need it elsewhere )

Added Paths:
-----------
    puppet/modules/openssl/
    puppet/modules/openssl/manifests/
    puppet/modules/openssl/manifests/init.pp

Added: puppet/modules/openssl/manifests/init.pp
===================================================================
--- puppet/modules/openssl/manifests/init.pp	                        (rev 0)
+++ puppet/modules/openssl/manifests/init.pp	2010-11-21 17:19:59 UTC (rev 345)
@@ -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"
+        }
+	}
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20101121/1c7ccce7/attachment.html>


More information about the Mageia-sysadm mailing list