Forge Home

hosts

Manages host entries

939,087 downloads

1,519 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 4.0.0 (latest)
  • 3.0.0
  • 2.7.0
  • 2.6.0
  • 2.5.0
  • 2.4.1
  • 2.4.0
  • 2.3.0
  • 2.2.3
  • 2.2.2
  • 2.2.1
  • 2.1.0
  • 2.0.1
  • 2.0.0
  • 1.0.0 (deleted)
released Dec 18th 2018
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 3.0.0 < 7.0.0
  • Debian, RedHat, CentOS, OracleLinux, Scientific, Solaris, SLES, SLED, Ubuntu

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'ghoneycutt-hosts', '2.7.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add ghoneycutt-hosts
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ghoneycutt-hosts --version 2.7.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

ghoneycutt/hosts — version 2.7.0 Dec 18th 2018

hosts module

Manage host entries.

Can ensure entries for localhost, localhost6, and $::fqdn, including aliases and optionally purge unmanaged entries.

Build Status

===

Compatibility

This module has been tested to work on the following systems with the latest Puppet v3, v3 with future parser, v4, v5 and v6. See .travis.yml for the exact matrix of supported Puppet and ruby versions.

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'