Puppet Class: postfix::config

Inherits:
postfix::params
Defined in:
manifests/config.pp

Overview

Parameters:

  • server_type (Any)
  • myhostname (Any)
  • mydomain (Any)
  • myorigin (Any)
  • mydestination (Any)
  • mynetworks_style (Any)
  • mynetworks (Any)
  • access (Any)
  • transport_maps (Any)
  • listen (Any)
  • relayhost (Any)
  • relay_domains (Any)
  • relay_recipients (Any)
  • message_size_limit (Any)
  • ssl (Any)
  • certhostname (Any)
  • root_destination (Any)
  • smtpd_timeout (Any)
  • smtpd_error_sleep_time (Any)


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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'manifests/config.pp', line 3

class postfix::config (
  $server_type,
  $myhostname,
  $mydomain,
  $myorigin,
  $mydestination,
  $mynetworks_style,
  $mynetworks,
  $access,
  $transport_maps,
  $listen,
  $relayhost,
  $relay_domains,
  $relay_recipients,
  $message_size_limit,
  $ssl,
  $certhostname,
  $root_destination,
  $smtpd_timeout,
  $smtpd_error_sleep_time) inherits postfix::params {
  $postfix_master_cf = $postfix::params::postfix_master_cf
  $postfix_main_cf   = $postfix::params::postfix_main_cf

  concat { $postfix_master_cf:
    owner  => 'root',
    group  => 'root',
    mode   => '0644',
    notify => Class[postfix::service]
  }

  postfix::config::master_process { 'header':
    content => "\n## Managed with Puppet modifications will be overwritten:\n\n",
    order   => 01,
  }

  postfix::config::master_process { 'postfix master default':
    content => template('postfix/master_cf_default.erb'),
    order   => 10
  }

  concat { '/etc/postfix/main.cf':
    owner  => 'root',
    group  => 'root',
    mode   => '0644',
    notify => Class[postfix::service]
  }

  postfix::config::main_config { 'header':
    content => "\n## Managed with Puppet modifications will be overwritten:\n\n",
    order   => 01,
  }

  postfix::config::main_config { 'default':
    content => template('postfix/main_cf_default.erb'),
    order   => 10,
  }

  postfix::config::main_config { 'smtpd_sender_restrictions':
    content => template('postfix/smtpd_sender_restrictions.erb'),
    order   => 20,
  }

  postfix::config::main_config { 'smtpd_recipient_restrictions':
    content => template('postfix/smtpd_recipient_restrictions.erb'),
    order   => 20,
  }

  file { '/etc/postfix/access':
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('postfix/access.erb'),
    notify  => Postfix::Postmap['access'],
  }

  postfix::postmap { 'access': }

  file { '/etc/postfix/transport':
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('postfix/transport.erb'),
    notify  => Postfix::Postmap['transport'],
  }

  postfix::postmap { 'transport': }

  file { '/etc/aliases':
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('postfix/aliases.erb'),
    notify  => Exec['postalias'],
  }

  exec { 'postalias':
    path        => '/bin:/sbin:/usr/bin:/usr/sbin',
    command     => 'postalias hash:/etc/aliases',
    refreshonly => true,
  }

  file { '/etc/postfix/relay_domains':
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('postfix/relay_domains.erb'),
    notify  => Class[postfix::service],
  }

  file { '/etc/postfix/relay_recipients':
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('postfix/relay_recipients.erb'),
    notify  => Postfix::Postmap['relay_recipients'],
  }

  postfix::postmap { 'relay_recipients': }

}