Defined Type: bind::controls::inet

Defined in:
manifests/controls/inet.pp

Summary

Manage an inet control channel

Overview

Examples:

Using the defined type


bind::controls::inet { '*':
  keys => [ 'rndc.key', ],
}

Parameters:

  • allow (Bind::AddressMatchList) (defaults to: [])

    The client addresses that are allowed to access this control channel.

  • keys (Array[String]) (defaults to: [])

    The name of the keys that will be used to authenticate access to this control channel.

  • read_only (Boolean) (defaults to: false)

    Should the control channel only allow read-only access.

  • address (String) (defaults to: $name)

    The IPv4 or IPv6 address where the control channel will be created. This can also be the string ‘*` for all local IPv4 addresses or the string `::` for all local IPv6 addresses.

  • port (Optional[Stdlib::Port]) (defaults to: undef)

    The port where the control channel will be listening. The default port 953 will be ised if this is unset.



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

define bind::controls::inet (
  Bind::AddressMatchList $allow     = [],
  Array[String]          $keys      = [],
  Boolean                $read_only = false,
  String                 $address   = $name,
  Optional[Stdlib::Port] $port      = undef,
) {
  # The base class must be included first
  unless defined(Class['bind']) {
    fail('You must include the bind base class before using any bind defined resources')
  }

  # Ignore control channel definition unless control_channels_enable is true
  if $bind::control_channels_enable {
    $_allow = empty($allow) ? {
      true    => undef,
      default => $allow.reduce('') |$memo,$k| { "${memo}${k}; " },
    }

    $_keys = empty($keys) ? {
      true    => undef,
      default => $keys.reduce('') |$memo,$k| { "${memo}\"${k}\"; " },
    }

    $params = {
      'allow'     => $_allow,
      'keys'      => $_keys,
      'read_only' => $read_only,
      'address'   => $address,
      'port'      => $port,
    }

    $content = epp("${module_name}/controls-inet.epp", $params)

    concat::fragment { "named.conf.controls-inet-${title}":
      target  => 'named.conf.options',
      order   => '92',
      content => "${content};",
    }

    # Include controls fragments from main config
    Concat::Fragment <| tag == 'named.conf.controls' |> {}
  }
}