summaryrefslogtreecommitdiff
path: root/manifests/sql.pp
blob: 67b906ed81a7db229fc8cf31f1ee371f2921a00f (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::sql {

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

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

  if $dovecot::mysql {
    include ::dovecot::sql::mysql
  }
  if $dovecot::pgsql {
    include ::dovecot::sql::pgsql
  }
  if $dovecot::sqlite {
    include ::dovecot::sql::sqlite
  }

  if $operatingsystem == 'Debian' {
    File['/etc/dovecot-sql.conf'] { path => '/etc/dovecot/dovecot-sql.conf' }
    File['/etc/dovecot-dict-sql.conf'] { path => '/etc/dovecot/dovecot-dict-sql.conf' }
  }
}