summaryrefslogtreecommitdiff
path: root/manifests/tls.pp
blob: cc917dfc7fbfdfc0a2571d20baec701cdf7b91e1 (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
class mail::tls {
  # TLS
  postfix::config { "smtpd_tls_cert_file":      value => '/etc/ssl/certs/cert.crt' }
  postfix::config { "smtpd_tls_key_file":       value => '/etc/ssl/private/cert.pem' }
  postfix::config { "smtpd_tls_CApath":         value => '/etc/ssl/certs' }
  postfix::config { "smtp_tls_CApath":          value => '/etc/ssl/certs' }
  postfix::config { "smtpd_tls_security_level": value => 'may' }
  postfix::config { "smtp_tls_security_level":  value => 'may' }

  $mail_virtual = hiera('mail::virtual', false)

  # SSL certificate
  ssl::cert { "${::domain}":
    group    => 'postfix',
    privmode => '0640',
    main     => true,
    notify   => $mail_virtual ? {
      false   => Service['postfix'],
      default => Service['postfix', 'dovecot'],
    }
  }

  # Check SSL certificate
  ssl::check { "${::domain}":
    file => true,
  }
}