Defined Type: nsd::pattern

Defined in:
manifests/pattern.pp

Overview

Define a pattern in NSD.

Examples:

Define a pattern

::nsd::pattern { 'example':
  allow_notify => [
    ['192.0.2.1', 'keyname.'],
  ],
  request_xfr  => [
    ['192.0.2.1', 'keyname.'],
  ],
}

Parameters:

  • pattern (String) (defaults to: $title)
  • order (Variant[Integer, String]) (defaults to: '10')
  • allow_notify (Optional[Array[NSD::ACL::AllowNotify, 1]]) (defaults to: undef)
  • allow_axfr_fallback (Optional[Boolean]) (defaults to: undef)
  • include_pattern (Optional[String]) (defaults to: undef)
  • notifies (Optional[Array[NSD::ACL::Notify, 1]]) (defaults to: undef)
  • notify_retry (Optional[Integer[0]]) (defaults to: undef)
  • outgoing_interface (Optional[NSD::Interface]) (defaults to: undef)
  • provide_xfr (Optional[Array[NSD::ACL::ProvideXFR, 1]]) (defaults to: undef)
  • request_xfr (Optional[Array[NSD::ACL::RequestXFR, 1]]) (defaults to: undef)
  • rrl_whitelist (Optional[Array[NSD::RRLType, 1]]) (defaults to: undef)
  • zonestats (Optional[String]) (defaults to: undef)

See Also:



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
# File 'manifests/pattern.pp', line 29

define nsd::pattern (
  String                                    $pattern             = $title,
  Variant[Integer, String]                  $order               = '10',
  Optional[Array[NSD::ACL::AllowNotify, 1]] $allow_notify        = undef,
  Optional[Boolean]                         $allow_axfr_fallback = undef,
  Optional[String]                          $include_pattern     = undef,
  Optional[Array[NSD::ACL::Notify, 1]]      $notifies            = undef, # Renamed to avoid clash with notify metaparameter
  Optional[Integer[0]]                      $notify_retry        = undef,
  Optional[NSD::Interface]                  $outgoing_interface  = undef,
  Optional[Array[NSD::ACL::ProvideXFR, 1]]  $provide_xfr         = undef,
  Optional[Array[NSD::ACL::RequestXFR, 1]]  $request_xfr         = undef,
  Optional[Array[NSD::RRLType, 1]]          $rrl_whitelist       = undef,
  Optional[String]                          $zonestats           = undef,
) {

  if ! defined(Class['::nsd']) {
    fail('You must include the nsd base class before using any nsd defined resources')
  }

  $_allow_notify = $allow_notify ? {
    undef   => undef,
    default => delete_undef_values($allow_notify.map |$acl| { nsd::flatten_acl($acl) }),
  }

  $_notifies = $notifies ? {
    undef   => undef,
    default => delete_undef_values($notifies.map |$acl| { nsd::flatten_acl($acl) }),
  }

  $_provide_xfr = $provide_xfr ? {
    undef   => undef,
    default => delete_undef_values($provide_xfr.map |$acl| { nsd::flatten_acl($acl) }),
  }

  $_request_xfr = $request_xfr ? {
    undef   => undef,
    default => delete_undef_values($request_xfr.map |$acl| { nsd::flatten_acl($acl) }),
  }

  ::concat::fragment { "nsd pattern ${pattern}":
    content => template('nsd/pattern.erb'),
    order   => "20${order}",
    target  => "${::nsd::conf_dir}/nsd.conf",
  }
}