summaryrefslogtreecommitdiff
path: root/puppet/modules/soledad/manifests/server.pp
blob: 339030fc7683dca5a07a462ec08dc6e94508a543 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
class soledad::server {
  tag 'leap_service'
  include soledad
  include site_apt::preferences::twisted

  $couchdb           = hiera('couch')
  $couchdb_users     = $couchdb['users']
  $couchdb_user      = $couchdb_users['soledad']['username']
  $couchdb_password  = $couchdb_users['soledad']['password']

  $couchdb_host = 'localhost'
  $couchdb_port = '5984'

  $soledad      = hiera('soledad')
  $soledad_port = $soledad['port']

  include site_config::x509::cert
  include site_config::x509::key
  include site_config::x509::ca

  #
  # 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  => latest,
    require => [
      Class['site_apt::preferences::twisted'],
      Class['site_apt::leap_repo'] ];
  }

  file { '/etc/default/soledad':
    content => template('soledad/default-soledad.erb'),
    owner   => 'soledad',
    group   => 'soledad',
    mode    => '0600',
    notify  => Service['soledad-server'],
    require => Class['soledad'];
  }

  service { 'soledad-server':
    ensure     => running,
    enable     => true,
    hasstatus  => true,
    hasrestart => true,
    require    => [
      Class['soledad'],
      Package['soledad-server'],
      Class['Site_config::X509::Key'],
      Class['Site_config::X509::Cert'],
      Class['Site_config::X509::Ca'] ];
  }

  include site_shorewall::soledad
}