Puppet Class: psick::dns::resolver

Defined in:
manifests/dns/resolver.pp

Overview

This class manages /etc/resolv.conf

Parameters:

  • nameservers (Array) (defaults to: ['8.8.8.8','8.8.4.4'])
  • options (Optional[Array]) (defaults to: undef)
  • search (Optional[Array]) (defaults to: undef)
  • domain (Optional[String]) (defaults to: undef)
  • sortlist (Optional[Array]) (defaults to: undef)
  • resolver_path (String) (defaults to: '/etc/resolv.conf')
  • resolver_template (String) (defaults to: 'psick/dns/resolver/resolv.conf.erb')
  • manage (Boolean) (defaults to: $psick::manage)
  • noop_manage (Boolean) (defaults to: $psick::noop_manage)
  • noop_value (Boolean) (defaults to: $psick::noop_value)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'manifests/dns/resolver.pp', line 2

class psick::dns::resolver (
  Array $nameservers           = ['8.8.8.8','8.8.4.4'],
  Optional[Array] $options     = undef,
  Optional[Array] $search      = undef,
  Optional[String] $domain     = undef,
  Optional[Array] $sortlist    = undef,
  String $resolver_path        = '/etc/resolv.conf',
  String $resolver_template    = 'psick/dns/resolver/resolv.conf.erb',

  Boolean $manage              = $psick::manage,
  Boolean $noop_manage         = $psick::noop_manage,
  Boolean $noop_value          = $psick::noop_value,
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }

    if $facts['virtual'] != 'docker' {
      file { $resolver_path:
        ensure  => file,
        content => template($resolver_template),
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
      }
    }
  }
}