Forge Home

hosts

Manage /etc/hosts entries

2,973 downloads

2,973 latest version

4.7 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

  • 0.1.0 (latest)
released Oct 30th 2023
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
  • , Archlinux, , Fedora

Start using this module

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

Add this module to your Puppetfile:

mod 'puppet-hosts', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install puppet-hosts --version 0.1.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

puppet/hosts — version 0.1.0 Oct 30th 2023

puppet-hosts

Build Status Release Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores puppetmodule.info docs AGPL v3 License

Table of contents

Usage

This module aims to provide default behavior which should work, without needing to set parameteres, for the majority of use cases. That is to:

  • Remove unused/uneeded/unmanaged /etc/hosts entries.
  • Ensure that a typical set of entries for the loopback and related ipv6 addresses are present- Create an entry for the host's FQDN address.
  • Provide an interface to create hosts entries via hiera data.

Please have a look at our REFERENCE.md. All parameters are documented in that file.

Examples

Typically, inclusion of the hosts class should be sufficent for most use cases.

include hosts

Creation of hosts entries via hiera:

lookup_options:
  hosts::hosts:
    merge:
      strategy: "deep"
hosts::entries:
  foo.example.com:
    ip: '10.0.0.1'
    host_aliases:
      - foo
  bar.example.com:
    ip: '10.0.0.2'
    host_aliases:
     - bar
  baz.example.com:
    ip: '10.0.0.3'
    host_aliases:
     - baz

Contributions

Contribution is fairly easy:

  • Fork the module into your namespace
  • Create a new branch
  • Commit your bugfix or enhancement
  • Write a test for it (maybe start with the test first)
  • Create a pull request

Detailed instructions are in the CONTRIBUTING.md file.

License and Author

This module was originally written by Joshua Hoblitt. It's licensed with AGPL version 3.