Puppet Class: r_profile::dns_client

Defined in:
manifests/dns_client.pp

Overview

R_profile::Dns_client

Support for configuring the DNS client (/etc/resolve.conf) and the Name Service Switch (/etc/nsswitch.conf and friends)

Parameters:

  • search (Any) (defaults to: hiera("r_profile::dns_client::search", undef))

    Domain to attempt resolution of short hostsnames in first

  • nameservers (Any) (defaults to: hiera("r_profile::dns_client::nameservers", undef))

    Array of nameservers to use

  • options (Any) (defaults to: hiera("r_profile::dns_client::options", undef))

    Options Array of options to use

  • nss_entries (Any) (defaults to: hiera("r_profile::dns_client::nss_entries", undef))

    Hash of settings to add to the nsswitch.conf file

  • install_defaults (Any) (defaults to: hiera("r_profile::dns_client::install_defaults", false))

    True to install module default DNS/NSS settings if nothing found in hiera, otherwise dont’ reconfigure dns

See Also:



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

class r_profile::dns_client(
    $search           = hiera("r_profile::dns_client::search", undef),
    $nameservers      = hiera("r_profile::dns_client::nameservers", undef),
    $options          = hiera("r_profile::dns_client::options", undef),
    $nss_entries      = hiera("r_profile::dns_client::nss_entries", undef),
    $install_defaults = hiera("r_profile::dns_client::install_defaults", false),
) {

  # setup /etc/resolve.conf
  if $nameservers or $install_defaults {
    class { "resolv_conf":
      search      => $search,
      nameservers => any2array($nameservers),
      options     => $options,
    }
  }

  if $nss_entries or $install_defaults {
    class { "name_service_switch":
      entries => $nss_entries,
    }
  }
}