Puppet Class: resolvconf

Defined in:
modules/resolvconf/manifests/init.pp

Overview

Parameters:

  • nameservers (Array[Stdlib::Host,1])

    a list of nameserveres to configre

  • timeout (Integer[1,30]) (defaults to: 1)

    the timeout option

  • attempts (Integer[1,5]) (defaults to: 3)

    the attempts option

  • ndots (Integer[1,15]) (defaults to: 1)

    the ndots option

  • disable_resolvconf (Boolean) (defaults to: false)

    stop resolvconf from messing with our resolv.conf

  • disable_dhcpupdates (Boolean) (defaults to: false)

    stop dhcpd from messing with our resolv.conf

  • domain_search (Array[Stdlib::Fqdn]) (defaults to: [$facts['domain']])


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'modules/resolvconf/manifests/init.pp', line 8

class resolvconf (
    Array[Stdlib::Host,1] $nameservers,
    Array[Stdlib::Fqdn]   $domain_search       = [$facts['domain']],
    Integer[1,30]         $timeout             = 1,
    Integer[1,5]          $attempts            = 3,
    Integer[1,15]         $ndots               = 1,
    Boolean               $disable_resolvconf  = false,
    Boolean               $disable_dhcpupdates = false,
){
    $_nameservers = $nameservers.map |$nameserver| {
        if $nameserver =~ Stdlib::IP::Address {
            $nameserver
        } else {
            $nameserver.ipresolve(4)
        }
    }
    if $disable_resolvconf {
        file { '/sbin/resolvconf':
            owner  => 'root',
            group  => 'root',
            mode   => '0555',
            source => 'puppet:///modules/resolvconf/resolvconf.dummy',
        }
    }
    if $disable_dhcpupdates {
        file { '/etc/dhcp/dhclient-enter-hooks.d':
            ensure => 'directory',
        }

        file { '/etc/dhcp/dhclient-enter-hooks.d/nodnsupdate':
            owner  => 'root',
            group  => 'root',
            mode   => '0555',
            source => 'puppet:///modules/resolvconf/nodnsupdate',
        }

    }

    file { '/etc/resolv.conf':
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('resolvconf/resolv.conf.erb'),
    }
}