diff options
Diffstat (limited to 'modules/openssl/manifests')
-rw-r--r-- | modules/openssl/manifests/init.pp | 12 |
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" + } + } +} |