diff options
| author | varac <varacanero@zeromail.org> | 2016-06-09 17:32:31 +0200 | 
|---|---|---|
| committer | varac <varacanero@zeromail.org> | 2016-06-14 12:05:18 +0200 | 
| commit | 1a18586f60291405af739fc787506566cf63e79c (patch) | |
| tree | fa5300de6fa9ec990b965d789aa3b75f3b7a3dd2 /puppet/modules/couchdb/manifests/ssl/generate_cert.pp | |
| parent | 6087aa329ff92ce02107792faf233279e6a77d55 (diff) | |
git subrepo clone https://leap.se/git/puppet_couchdb puppet/modules/couchdb
subrepo:
  subdir:   "puppet/modules/couchdb"
  merged:   "76ff149"
upstream:
  origin:   "https://leap.se/git/puppet_couchdb"
  branch:   "master"
  commit:   "76ff149"
git-subrepo:
  version:  "0.3.0"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "cb2995b"
Diffstat (limited to 'puppet/modules/couchdb/manifests/ssl/generate_cert.pp')
| -rw-r--r-- | puppet/modules/couchdb/manifests/ssl/generate_cert.pp | 25 | 
1 files changed, 25 insertions, 0 deletions
| diff --git a/puppet/modules/couchdb/manifests/ssl/generate_cert.pp b/puppet/modules/couchdb/manifests/ssl/generate_cert.pp new file mode 100644 index 00000000..a443250e --- /dev/null +++ b/puppet/modules/couchdb/manifests/ssl/generate_cert.pp @@ -0,0 +1,25 @@ +# configures cert for ssl access +class couchdb::ssl::generate_cert { + +  ensure_packages('openssl') + +  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'], +  } +} | 
