summaryrefslogtreecommitdiff
path: root/manifests/firma.pp
blob: 2f9bbe994e3e91f0853136c1849393e52ef2ccbd (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
class mail::firma(
  $subdomain = lookup('firma_subdomain', undef, undef, $::mail::firma::params::subdomain)
) {

  # Firma subsystems
  include mail::firma::packages

  postfix::config { "firma_destination_recipient_limit": value => '1', nonstandard => true }

  mail::firma::domain { "${subdomain}.${domain}": }

  postfix::transport { "${subdomain}.$domain":
    ensure      => absent,
    destination => "firma",
  }

  group { "firma":
    ensure    => present,
    allowdupe => false,
  }

  user { "firma":
    ensure    => present,
    allowdupe => false,
    gid       => 'firma',
    require   => Group['firma'],
    home      => '/var/lib/firma',
  }

  vcsrepo { "/var/lib/firma":
    ensure   => present,
    provider => git,
    source   => 'https://git.fluxo.info/firma',
    revision => 'df18d0c7060007aaa757ea749bcbb66814d1f4ce',
    owner    => 'firma',
    group    => 'firma',
    require  => [ User['firma'], Group['firma'] ],
  }

  file { '/usr/local/bin/firma':
    ensure  => '/var/lib/firma/firma',
    owner   => root,
    group   => root,
    require => Vcsrepo['/var/lib/firma'],
  }

  file { '/var/lib/firma/firma.conf':
    ensure => present,
    owner   => firma,
    group   => firma,
    mode    => '0600',
    require => Vcsrepo['/var/lib/firma'],
    source => "puppet:///modules/mail/firma/firma.conf",
  }
}