config.pp 581 Bytes
Newer Older
Francois Deppierraz's avatar
Francois Deppierraz committed
1
define postfix::config ($ensure = present, $value, $nonstandard = false) {
2
3
4
5
6
7
8
9
10
11
12
13
14
  case $ensure {
    present: {
      exec {"postconf -e ${name}='${value}'":
        unless  => $nonstandard ? {
          false => "test \"x$(postconf -h ${name})\" == 'x${value}'",
          true  => "test \"x$(egrep '^${name} ' /etc/postfix/main.cf | cut -d= -f2 | cut -d' ' -f2)\" == 'x${value}'",
        },
        notify  => Service["postfix"],
        require => File["/etc/postfix/main.cf"],
      }
    }

    absent: {
Francois Deppierraz's avatar
Francois Deppierraz committed
15
      fail "postfix::config ensure => absent: Not implemented"
16
17
18
    }
  }
}