Version information
This version is compatible with:
- Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 3.0.0 < 5.0.0
- Debian, RedHat, CentOS, OracleLinux, Scientific, Solaris, SLES, SLED, Ubuntu
Start using this module
Add this module to your Puppetfile:
mod 'gearboxscott-hosts', '2.5.1'
Learn more about managing modules with a PuppetfileDocumentation
Origin Credits:
This module was originally forked from Garrett Honeycutt's puppet-module-hosts. The host resource was updated to allow the creation of FQDN in /etc/hosts files (Issue #40: https://github.com/ghoneycutt/puppet-module-hosts/issues/40)
Doesn't appear the Garrett is maintaining this module anymore on the Puppet Forge. Reposting this module on the Puppet Forge with the correction in place.
hosts module
Manage host entries.
Can ensure entries for localhost, localhost6, and $::fqdn, including aliases and optionally purge unmanaged entries.
===
Compatibility
This module is built for use with Puppet v3 (with and without the future parser) and Puppet v4 on the following platforms and supports Ruby versions 1.8.7, 1.9.3, 2.0.0, 2.1.0 and 2.3.1.
It should work with any *nix based system that uses /etc/hosts
.
===
Parameters
enable_ipv4_localhost
Boolean to enable ipv4 localhost entry
- Default: true
enable_ipv6_localhost
Boolean to enable ipv6 localhost entry
- Default: true
enable_fqdn_entry
Boolean to enable entry for fqdn
- Default: true
use_fqdn
When enabled use the ${::fqdn} fact to determine the hosts entry for the local node.
- Default: true
fqdn_host_aliases
String or Array of aliases for fqdn
- Default: $::hostname
localhost_aliases
String or Array of aliases for localhost
- Default: [ 'localhost', 'localhost4', 'localhost4.localdomain4' ]
localhost6_aliases
String or Array of aliases for localhost6
- Default: [ 'localhost6', 'localhost6.localdomain6' ]
purge_hosts
Boolean to optionally purge unmanaged entries from hosts
- Default: false
target
String for path to hosts file
- Default: /etc/hosts
collect_all
Boolean to optionally collect all the exported Host resources
- Default: false
host_entries
Hash of host entries
- Default: undef
===
Hiera example of host_entries
hosts::host_entries: 'servicename.example.com': ip: '10.0.0.5' host_aliases:
- 'servicename'
Dependencies
- puppetlabs/stdlib (>= 4.6.0 < 6.0.0)
Copyright (C) 2010-2016 Garrett Honeycutt <code@garretthoneycutt.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.