Puppet Class: resolvconf
- Defined in:
- modules/resolvconf/manifests/init.pp
Summary
simple class to configure resolv.confOverview
SPDX-License-Identifier: Apache-2.0
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 53 54 55 56 57 |
# File 'modules/resolvconf/manifests/init.pp', line 11
class resolvconf (
Array[Stdlib::Host,1] $nameservers,
Array[Stdlib::Fqdn] $domain_search = [$facts['networking']['domain']],
Integer[1,30] $timeout = 1,
Integer[1,5] $attempts = 3,
Integer[1,15] $ndots = 1,
Boolean $disable_resolvconf = false,
Boolean $disable_dhcpupdates = false,
Boolean $manage_resolv_conf = true,
) {
$_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',
}
}
if $manage_resolv_conf {
file { '/etc/resolv.conf':
owner => 'root',
group => 'root',
mode => '0444',
content => template('resolvconf/resolv.conf.erb'),
}
}
}
|