summaryrefslogtreecommitdiff
path: root/manifests/base.pp
blob: b26554704114ce6e4d33fef708b56eb45cec70cb (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
# manages the basic stuff for the service
class ejabberd::base {
  package{'ejabberd':
    ensure => installed,
  }

  file{'/etc/ejabberd/ejabberd.cfg':
    require => Package['ejabberd'],
    notify  => Service['ejabberd'],
    owner   => 'root',
    group   => 'ejabberd',
    mode    => '0640';
  }

  if $ejabberd::config_content {
    File['/etc/ejabberd/ejabberd.cfg']{
      content => $ejabberd::config_content
    }
  } else {
    File['/etc/ejabberd/ejabberd.cfg']{
      source => [ "puppet:///modules/site_ejabberd/${::fqdn}/ejabberd.cfg",
                  'puppet:///modules/site_ejabberd/ejabberd.cfg',
                  'puppet:///modules/ejabberd/ejabberd.cfg' ]
    }
  }

  service{'ejabberd':
    ensure => running,
    enable => true,
    hasstatus => $operatingsystem ? {
      'debian' => false,
      default  => true,
    },
    pattern => '/usr/lib/ejabberd/ebin',
    require => Package[ejabberd],
  }
}