From b4020afadc24aa6c1da3a1b8b0b2aa7936353d1d Mon Sep 17 00:00:00 2001 From: kwadronaut Date: Tue, 25 Sep 2012 10:11:45 +0200 Subject: adding ssl support --- manifests/ssl.pp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 manifests/ssl.pp (limited to 'manifests/ssl.pp') diff --git a/manifests/ssl.pp b/manifests/ssl.pp new file mode 100644 index 0000000..633cf2f --- /dev/null +++ b/manifests/ssl.pp @@ -0,0 +1,26 @@ +class couchdb::ssl { + + 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'], + } +} -- cgit v1.2.3