From 3330fbab993e2190d9f85629b71d78c3f9020789 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sun, 21 Nov 2010 17:19:59 +0000 Subject: - add a class to generate self signed certificate ( as we may likely need it elsewhere ) --- modules/openssl/manifests/init.pp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 modules/openssl/manifests/init.pp (limited to 'modules') 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" + } + } +} -- cgit v1.2.1