summaryrefslogtreecommitdiff
path: root/puppet/modules/soledad/manifests/server.pp
diff options
context:
space:
mode:
authorMicah Anderson <micah@leap.se>2013-07-26 14:11:33 -0400
committerMicah Anderson <micah@leap.se>2013-07-26 14:11:33 -0400
commit8d28379aca4d8a79caa00afbf79ad4e5a204493f (patch)
tree5fa0bedba730c04762953e0d49deaba8554d08f2 /puppet/modules/soledad/manifests/server.pp
parentc8922ffdf2ec8f459c4ed225329ea5fb634f4799 (diff)
parent1c9c5a5fec51919a8e9ec14f5fe9b16c538bb4fa (diff)
Merge branch 'feature/soledad' into feature/leap_mx
Diffstat (limited to 'puppet/modules/soledad/manifests/server.pp')
-rw-r--r--puppet/modules/soledad/manifests/server.pp62
1 files changed, 62 insertions, 0 deletions
diff --git a/puppet/modules/soledad/manifests/server.pp b/puppet/modules/soledad/manifests/server.pp
new file mode 100644
index 00000000..06de8642
--- /dev/null
+++ b/puppet/modules/soledad/manifests/server.pp
@@ -0,0 +1,62 @@
+class soledad::server {
+ tag 'leap_service'
+ include soledad
+
+ $couchdb = hiera('couch')
+ $couchdb_host = 'localhost'
+ $couchdb_port = '4096'
+ $couchdb_user = $couchdb['users']['soledad']['username']
+ $couchdb_password = $couchdb['users']['soledad']['password']
+
+ $x509 = hiera('x509')
+ $x509_key = $x509['key']
+ $x509_cert = $x509['cert']
+ $x509_ca = $x509['ca_cert']
+
+ x509::key { 'soledad':
+ content => $x509_key,
+ notify => Service['soledad-server'];
+ }
+
+ x509::cert { 'soledad':
+ content => $x509_cert,
+ notify => Service['soledad-server'];
+ }
+
+ x509::ca { 'soledad':
+ content => $x509_ca,
+ notify => Service['soledad-server'];
+ }
+
+ #
+ # SOLEDAD CONFIG
+ #
+
+ file { '/etc/leap/soledad-server.conf':
+ content => template('soledad/soledad-server.conf.erb'),
+ owner => 'soledad',
+ group => 'soledad',
+ mode => '0600',
+ notify => Service['soledad-server'],
+ require => Class['soledad'];
+ }
+
+ package { 'soledad-server':
+ ensure => installed
+ }
+
+ file { '/etc/default/soledad':
+ content => "CERT_PATH=/etc/x509/certs/soledad.crt\nPRIVKEY_PATH=/etc/x509/keys/soledad.key\n",
+ require => Package['soledad-server']
+ }
+
+ service { 'soledad-server':
+ ensure => running,
+ enable => true,
+ hasstatus => true,
+ hasrestart => true,
+ require => [ Class['soledad'], Package['soledad-server'] ];
+ }
+
+ include site_shorewall::soledad
+}