diff options
author | varac <varacanero@zeromail.org> | 2012-10-31 13:49:38 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2012-10-31 13:49:38 +0100 |
commit | 24750a47f7a2ca82acfcf5c91eb70727158d6bc6 (patch) | |
tree | ea34b4bbb61362c14763aa8e64f828e9c4ecbf26 /manifests/ssl | |
parent | 95beaab25a31a6b295d9c8ce809cc254a109e484 (diff) |
renamed: ssl.pp -> ssl/generate_cert.pp
Diffstat (limited to 'manifests/ssl')
-rw-r--r-- | manifests/ssl/generate_cert.pp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/manifests/ssl/generate_cert.pp b/manifests/ssl/generate_cert.pp new file mode 100644 index 0000000..dae091c --- /dev/null +++ b/manifests/ssl/generate_cert.pp @@ -0,0 +1,26 @@ +class couchdb::ssl::generate_cert { + + package { ['openssl']: + ensure => 'installed', + } + + file { $couchdb::cert_path: + ensure => 'directory', + mode => '0600', + owner => 'couchdb', + group => 'couchdb'; + } + +exec { 'generate-certs': + command => "/usr/bin/openssl req -new -inform PEM -x509 -nodes -days 150 -subj \ +'/C=ZZ/ST=AutoSign/O=AutoSign/localityName=AutoSign/commonName=${::hostname}/organizationalUnitName=AutoSign/emailAddress=AutoSign/' \ +-newkey rsa:2048 -out ${couchdb::cert_path}/couchdb_cert.pem -keyout ${couchdb::cert_path}/couchdb_key.pem", + unless => "/usr/bin/test -f ${couchdb::cert_path}/couchdb_cert.pem && +/usr/bin/test -f ${couchdb::params::cert_path}/couchdb_key.pem", + require => [ + File[$couchdb::params::cert_path], + Exec['make-install'] + ], + notify => Service['couchdb'], + } +} |