summaryrefslogtreecommitdiff
path: root/manifests/base.pp
blob: 522b99e88743eb23646a7c48ecaafd1df5272afb (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
class dovecot::base {

  package { 'dovecot':
    alias => 'dovecot',
    ensure => installed,
  }

  file { '/etc/dovecot.conf':
    source => [ "puppet:///modules/site-dovecot/config/${fqdn}/dovecot.conf",
                "puppet:///modules/site-dovecot/config/${dovecot::type}/dovecot.conf",
                "puppet:///modules/site-dovecot/config/dovecot.conf",
                "puppet:///modules/dovecot/config/${operatingsystem}/dovecot.conf",
                "puppet:///modules/dovecot/config/dovecot.conf" ],
    require => Package['dovecot'],
    notify => Service['dovecot'],
    owner => root, group => mail, mode => 0640;
  }

  file {
    '/var/log/dovecot':
      ensure => directory,
      require => Package['dovecot'],
      before => Service['dovecot'],
      owner => dovecot, group => dovecot, mode => 0660;

    [ '/var/log/dovecot/error.log',
      '/var/log/dovecot/infos.log' ]:
        require => Package['dovecot'],
        before => Service['dovecot'],
        owner => root, group => dovecot, mode => 0660;
  }

  include dovecot::logrotate

  service { 'dovecot':
    ensure => running,
    enable => true,
  }
}