Forge Home

hosts

A template-based module to manage /etc/hosts

91,049 downloads

382 latest version

5.0 quality score

Version information

  • 4.0.4 (latest)
  • 4.0.3
  • 4.0.2
  • 4.0.1
  • 4.0.0
  • 3.2.1
  • 3.2.0
  • 3.1.0
  • 3.0.1
  • 3.0.0
  • 2.4.0
  • 2.3.1
  • 2.3.0
  • 2.2.7
  • 2.2.6
  • 2.2.5
  • 2.2.4
  • 2.2.3
  • 2.2.2
  • 2.2.1
  • 2.2.0
  • 2.1.1
  • 2.1.0
  • 2.0.5
  • 2.0.4
  • 2.0.3
  • 2.0.2
  • 2.0.1
  • 2.0.0
  • 1.0.2
  • 1.0.1 (deleted)
  • 0.1.3 (deleted)
  • 0.1.2 (deleted)
  • 0.1.0 (deleted)
released Apr 17th 2022
This version is compatible with:
  • Puppet Enterprise 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 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
  • Puppet >= 5.5.0
  • Gentoo, RedHat, Debian, Ubuntu, CentOS, Solaris, SLES, SLED, FreeBSD, Darwin, AIX

Start using this module

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

Add this module to your Puppetfile:

mod 'chrekh-hosts', '4.0.4'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install chrekh-hosts --version 4.0.4

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
Tags: hosts

Documentation

chrekh/hosts — version 4.0.4 Apr 17th 2022

hosts

A template-based module to manage /etc/hosts. The main goal for this module is to add entries for localhost and primary address based on existing ip-adresses on existing interfaces. as reported by structured fact networking[]. Tested by me on Gentoo, SLES, RedHat, and OS X. But it should work or any Linux and Unix-like OS.

This module unconditionally overwrites your hosts file.

Usage

class { 'hosts': }

Hiera example

hosts::one_primary_ipv4: false
hosts::one_primary_ipv6: false
hosts::entries:
  '::2':
    - 'localhost2'
  'Foocluster nodes':
    '2001:db8:abba::1':
      - 'node1.example.org'
      - 'node1'
    '2001:db8:abba::2':
      - 'node2.example.org'
      - 'node2'