summaryrefslogtreecommitdiff
path: root/puppet/modules/site_couchdb/manifests/apache_ssl_proxy.pp
blob: 921707805846017267eec3942b2cf02a823f5add (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
define site_couchdb::apache_ssl_proxy ($key, $cert) {

  $apache_no_default_site = true
  include apache::ssl
  apache::module {
    'rewrite':      ensure => present;
    'proxy':        ensure => present;
    'proxy_http':   ensure => present;
  }
  apache::vhost::file { 'couchdb_proxy': }
  # prevent 0-default.conf and 0-default_ssl.conf from apache module
  # from starting on port 80 / 443
  file { '/etc/apache2/ports.conf':
    content => '',
    mode    => '0644',
    owner   => 'root',
    group   => 'root',
  }

  file { '/etc/couchdb/server_cert.pem':
    mode    => '0644',
    owner   => 'couchdb',
    group   => 'couchdb',
    content => $cert,
    notify  => Service[apache],
  }

  file { '/etc/couchdb/server_key.pem':
    mode    => '0600',
    owner   => 'couchdb',
    group   => 'couchdb',
    content => $key,
    notify  => Service[apache],
  }

}