summaryrefslogtreecommitdiff
path: root/manifests/base.pp
blob: 6eee36fc357ded36046bf530a05d8bf9bf302856 (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
# 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 => true,
    require   => Package['ejabberd'],
  }
}