Defined Type: nsd::key

Defined in:
manifests/key.pp

Overview

Define a TSIG key in NSD.

Examples:

Configure a SHA256 TSIG key

::nsd::key { 'keyname.':
  algorithm => 'hmac-sha256',
  secret    => '6z+8iKRIQrwN43TFfO/Rf2NHzpHIFVi6PsJ7dDESclc=',
}

Parameters:

  • algorithm (NSD::Algorithm)

    The TSIG key algorithm

  • secret (String)

    The Base64-encoded TSIG key secret

  • key (Bodgitlib::Zone::NonRoot) (defaults to: $title)

    The name of the key

See Also:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'manifests/key.pp', line 16

define nsd::key (
  NSD::Algorithm           $algorithm,
  String                   $secret,
  Bodgitlib::Zone::NonRoot $key       = $title,
) {

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

  if versioncmp($::puppetversion, '4.9.0') >= 0 {
    if $secret != String(Binary($secret), '%B') {
      fail('Key secret is not Base64-encoded correctly')
    }
  }

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