Defined Type: unbound::stub

Defined in:
manifests/stub.pp

Overview

Define a stub zone in Unbound.

Examples:

Create a stub zone

::unbound::stub { 'example.com.':
  stub_addr => [
    '192.0.2.1',
    '2001:db8::1',
  ],
}

Parameters:

  • zone (Bodgitlib::Zone) (defaults to: $title)
  • stub_host (Optional[Array[Bodgitlib::Hostname, 1]]) (defaults to: undef)
  • stub_addr (Optional[Array[Unbound::Interface::Incoming, 1]]) (defaults to: undef)
  • stub_prime (Optional[Boolean]) (defaults to: undef)
  • stub_first (Optional[Boolean]) (defaults to: undef)
  • stub_ssl_upstream (Optional[Boolean]) (defaults to: undef)

See Also:



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'manifests/stub.pp', line 21

define unbound::stub (
  Bodgitlib::Zone                                  $zone              = $title,
  Optional[Array[Bodgitlib::Hostname, 1]]          $stub_host         = undef,
  Optional[Array[Unbound::Interface::Incoming, 1]] $stub_addr         = undef,
  Optional[Boolean]                                $stub_prime        = undef,
  Optional[Boolean]                                $stub_first        = undef,
  Optional[Boolean]                                $stub_ssl_upstream = undef,
) {

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

  ::concat::fragment { "unbound stub ${zone}":
    content => template("${module_name}/stub.erb"),
    order   => "10-${zone}",
    target  => "${::unbound::conf_dir}/unbound.conf",
  }
}