hosts
: Manage /etc/hosts
hosts::collect_lo
: Collect addresses on the loopback interface from fact networking.hosts::collect_other
: Collect addresses from all interfaces except loopback from fact networking.hosts::excludefilter
: Helper function for exclusion of addresseshosts::includefilter
: Helper function for inclusion of addresseshosts::tabs
: Helper function for creating right amount of tabs for alignment.
Manage /etc/hosts
include hosts
class { 'hosts':
'one_primary_ipv4' => false,
'one_primary_ipv6' => false,
}
The following parameters are available in the hosts
class:
file
one_primary_ipv4
one_primary_ipv6
enable_ipv4
enable_ipv6
include_ipv4
include_ipv6
exclude_ipv4
exclude_ipv6
include_ifs
exclude_ifs
loopback_if
lo_ipv4
lo_ipv6
primary_ipv4
primary_ipv6
lo_names
primary_names
root_group
entries
Data type: Stdlib::Absolutepath
The file to manage.
Default value: '/etc/hosts'
Data type: Boolean
If true, only use the first address from primary_ipv4.
Default value: true
Data type: Boolean
If true, only use the first address from primary_ipv6.
Default value: true
Data type: Boolean
If false, don't add IPv4 loopback or primary addresses. (IPv4 addresses from hosts::entries is still added)
Default value: true
Data type: Boolean
If false, don't add IPv6 loopback or primary addresses. (IPv6 addresses from hosts::entries is still added)
Default value: true
Data type: Array[String]
A list of regexp. If the list is empty all IPv4 addresses are included. If the list is not empty all IPv4 addresses matching any of the regexps are included.
Default value: []
Data type: Array[String]
A list of regexp. If the list is empty all IPv6 addresses are included. If the list is not empty all IPv6 addresses matching any of the regexps are included.
Default value: []
Data type: Array[String]
A list of regexp. Exclude IPv4 addresses that matches any of the regexps.
Default value: []
Data type: Array[String]
A list of regexp. Exclude IPv6 addresses that matches any of the regexps.
Default value: []
Data type: Array[String]
A list of regexp. If the list is empty addresses from all interfaces are included. If the list is not empty only addresses from interfaces matching any of the regexps are included.
Default value: []
Data type: Array[String]
A list of regexp. Exclude addresses from interfaces that match any of the regexps.
Default value: []
Data type: String
The name of the loopback interface.
Default value: 'lo'
Data type: Array[Stdlib::IP::Address::V4::Nosubnet]
List of IPv4 addresses for localhost. Empty list means no entry.
Default value: hosts::collect_lo('ip',$loopback_if)
Data type: Array[Stdlib::IP::Address::V6::Nosubnet]
List of IPv6 addresses for localhost. Empty list means no entry.
Default value: hosts::collect_lo('ip6',$loopback_if)
Data type: Array[Stdlib::IP::Address::V4::Nosubnet]
List of IPv4 addresses. Empty list means no entry.
Default value: hosts::collect_other('ip',$loopback_if, $include_ifs,$exclude_ifs)
Data type: Array[Stdlib::IP::Address::V6::Nosubnet]
List of IPv6 addresses. Empty list means no entry.
Default value: hosts::collect_other('ip6',$loopback_if, $include_ifs,$exclude_ifs)
Data type: Array[String]
List of names for localhost.
Default value: [ 'localhost' ]
Data type: Array[String]
List of names for primary addresses.
Default value: [ $::fqdn, $::hostname ]
Data type: Variant[Integer[0],String[1]]
Group that should own the hosts file.
Default value: 'root'
Data type: Hash
A hash with additional host entries to add. Entries in this hash overrides automatic hostentries for IP's on local interfaces. The content can be either comment => { ip => [ names ], ... } or just ip => [ names ].
Default value: {}