- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with resolv
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
This module configures the Resolv file.
This module handles configuring Resolv across a range of operating systems and distributions.
- resolv configuration file.
- Puppet >= 3.0
- Facter >= 1.6
- Extlib module
- Stdlib module
Install resolv with the default parameters (No configuration files will be changed).
class { 'resolv': }
Install resolv with the recommended parameters.
class { 'resolv':
config_file_template => 'resolv/common/etc/resolv.conf.erb',
}
Update the resolv package.
class { 'resolv':
package_ensure => 'latest',
}
Remove the resolv package.
class { 'resolv':
package_ensure => 'absent',
}
Purge the resolv package (All configuration files will be removed).
class { 'resolv':
package_ensure => 'purged',
}
Deploy the configuration files from source directory.
class { 'resolv':
config_dir_source => 'puppet:///modules/resolv/common/etc',
}
Deploy the configuration files from source directory (Unmanaged configuration files will be removed).
class { 'resolv':
config_dir_purge => true,
config_dir_source => 'puppet:///modules/resolv/common/etc',
}
Deploy the configuration file from source.
class { 'resolv':
config_file_source => 'puppet:///modules/resolv/common/etc/resolv.conf',
}
Deploy the configuration file from string.
class { 'resolv':
config_file_string => '# THIS FILE IS MANAGED BY PUPPET',
}
Deploy the configuration file from template.
class { 'resolv':
config_file_template => 'resolv/common/etc/resolv.conf.erb',
}
Deploy the configuration file from custom template (Additional parameters can be defined).
class { 'resolv':
config_file_template => 'resolv/common/etc/resolv.conf.erb',
config_file_options_hash => {
'key' => 'value',
},
}
Deploy additional configuration files from source, string or template.
class { 'resolv':
config_file_hash => {
'resolv.2nd.conf' => {
config_file_path => '/etc/resolv.2nd.conf',
config_file_source => 'puppet:///modules/resolv/common/etc/resolv.2nd.conf',
},
'resolv.3rd.conf' => {
config_file_path => '/etc/resolv.3rd.conf',
config_file_string => '# THIS FILE IS MANAGED BY PUPPET',
},
'resolv.4th.conf' => {
config_file_path => '/etc/resolv.4th.conf',
config_file_template => 'resolv/common/etc/resolv.4th.conf.erb',
},
},
}
- resolv: Main class, includes all other classes.
- resolv::install: Handles the packages.
- resolv::config: Handles the configuration file.
Determines if the package should be installed. Valid values are 'present', 'latest', 'absent' and 'purged'. Defaults to 'present'.
Determines the name of package to manage. Defaults to 'undef'.
Determines if additional packages should be managed. Defaults to 'undef'.
Determines if the configuration directory should be present. Valid values are 'absent' and 'directory'. Defaults to 'directory'.
Determines if the configuration directory should be managed. Defaults to '/etc'
Determines if unmanaged configuration files should be removed. Valid values are 'true' and 'false'. Defaults to 'false'.
Determines if the configuration directory should be recursively managed. Valid values are 'true' and 'false'. Defaults to 'true'.
Determines the source of a configuration directory. Defaults to 'undef'.
Determines if the configuration file should be present. Valid values are 'absent' and 'present'. Defaults to 'present'.
Determines if the configuration file should be managed. Defaults to '/etc/resolv.conf'
Determines which user should own the configuration file. Defaults to 'root'.
Determines which group should own the configuration file. Defaults to 'root'.
Determines the desired permissions mode of the configuration file. Defaults to '0644'.
Determines the source of a configuration file. Defaults to 'undef'.
Determines the content of a configuration file. Defaults to 'undef'.
Determines the content of a configuration file. Defaults to 'undef'.
Determines which package a configuration file depends on. Defaults to 'undef'.
Determines which configuration files should be managed via resolv::define
.
Defaults to '{}'.
Determines which parameters should be passed to an ERB template. Defaults to '{}'.
Determines which domains should be searched. Defaults to '["${::domain}"]'.
Determines which nameservers should be queried. Defaults to '['8.8.8.8', '8.8.4.4']'.
Determines which options should be used if more than one nameserver is present. Defaults to '['timeout:1', 'attempts:1', 'rotate']'.
This module has been tested on:
- Debian 6/7/8
- Ubuntu 12.04/14.04/16.04
If you find a bug, have trouble following the documentation or have a question about this module - please create an issue.
If you are able to patch the bug or add the feature yourself - please make a pull request.
The list of contributors can be found at: https://github.com/dhoppe/puppet-resolv/graphs/contributors