[Mageia-sysadm] [530] add a type for selfsigned certificate in 2 file
root at mageia.org
root at mageia.org
Tue Dec 7 03:40:30 CET 2010
Revision: 530
Author: misc
Date: 2010-12-07 03:40:29 +0100 (Tue, 07 Dec 2010)
Log Message:
-----------
add a type for selfsigned certificate in 2 file
Modified Paths:
--------------
puppet/modules/openssl/manifests/init.pp
Modified: puppet/modules/openssl/manifests/init.pp
===================================================================
--- puppet/modules/openssl/manifests/init.pp 2010-12-07 02:40:28 UTC (rev 529)
+++ puppet/modules/openssl/manifests/init.pp 2010-12-07 02:40:29 UTC (rev 530)
@@ -15,4 +15,29 @@
require => Package['openssl']
}
}
+
+ define self_signed_splitted_cert($filename = '',
+ $directory = '/etc/certs',
+ $owner = "root",
+ $group = 'root',
+ $mode = '600') {
+ include openssl::base
+
+ $crt_file = "$filename.crt"
+ $key_file = "$filename.key"
+ exec { "openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $key_file -out $crt_file -subj '/CN=$name'":
+ cwd => "$directory",
+ creates => "$directory/$key_file",
+ require => Package['openssl'],
+ before => [ File["$directory/$key_file"],
+ File["$directory/$crt_file"]]
+ }
+
+ file { ["$directory/$key_file","$directory/$crt_file"]:
+ owner => $owner,
+ group => $group,
+ mode => $mode
+ }
+ }
+
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20101207/e227da80/attachment-0001.html>
More information about the Mageia-sysadm
mailing list