summaryrefslogtreecommitdiff
path: root/manifests/definitions/bind-mx.pp
blob: 5090932cb0c585f52a479a57c5ff9cbbf5160289 (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
/*

= Definition: bind::mx
Creates an MX record.

Arguments:
 *$zone*:     Bind::Zone name
 *$owner*:    owner of the Resource Record
 *$priority*: MX record priority
 *$host*:     target of the Resource Record
 *$ttl*:      Time to Live for the Resource Record. Optional.

*/
define bind::mx($ensure=present,
    $zone,
    $owner,
    $priority,
    $host,
    $ttl=false) {

  common::concatfilepart{"bind.${name}":
    file    => "/etc/bind/pri/${zone}",
    ensure  => $ensure,
    notify  => Service["bind9"],
    content => template("bind/mx-record.erb"),
    require => [Bind::Zone[$zone], Bind::A[$host]],
  }
}