summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/conf.pp0
-rw-r--r--manifests/init.pp2
-rw-r--r--manifests/params.pp5
-rw-r--r--manifests/ssl.pp26
4 files changed, 32 insertions, 1 deletions
diff --git a/manifests/conf.pp b/manifests/conf.pp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/manifests/conf.pp
diff --git a/manifests/init.pp b/manifests/init.pp
index 7d52c59..cc25f10 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -2,7 +2,7 @@ class couchdb {
case $operatingsystem {
Debian: {
case $lsbdistcodename {
- /lenny|squeeze/: { include couchdb::debian }
+ /lenny|squeeze|wheezy/: { include couchdb::debian }
default: { fail "couchdb not available for ${operatingsystem}/${lsbdistcodename}"}
}
}
diff --git a/manifests/params.pp b/manifests/params.pp
index df59ad0..4f4487f 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -15,4 +15,9 @@ class couchdb::params {
default => $couchdb_backupdir,
}
+ $cert_path = $couchdb_cert_path ? {
+ "" => "etc/certs/",
+ default => $couchdb_cert_path,
+ }
+
}
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'],
+ }
+}