Version information
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
- Debian, RedHat, CentOS, OracleLinux, Scientific, Solaris, SLES, SLED, Ubuntu
Start using this module
Add this module to your Puppetfile:
mod 'ghoneycutt-hosts', '4.0.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet-module-hosts
Table of Contents
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with hosts
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
This is a very simple module to manage host entries in /etc/hosts
. It
works by applying a hash of host
resources.
Documented with Puppet Strings at http://ghoneycutt.github.io/puppet-module-hosts/.
Setup
What hosts affects
Generally just the /etc/hosts
file though you may use the target
attribute of the host
resource to manage host entries in other files.
Setup requiremements
The ability to manage /etc/hosts
was moved out of Puppet and into a
core module at
https://github.com/puppetlabs/puppetlabs-host_core
and this module relies upon it.
Beginning with hosts
Declare the hosts
class.
Usage
The normal use case. If you are not adding the local system by default
as shown below, this is a good option. Then you can just add
hosts::hosts
entries throughout Hiera.
include hosts
Sample profile which implements functionality from previous versions.
# Lookup everything in Hiera using the key 'host_entries' and add the
# local system with its FQDN and IP address.
$hosts = lookup('host_entries', undef, deep, {}) + {
$facts['networking']['hostname'] => {
ensure => present,
host_aliases => [$facts['networking']['fqdn']],
ip => $facts['networking']['ip'],
}
}
class { 'hosts':
hosts => $hosts,
}
Limitations
This module officially supports the platforms listed in the
metadata.json
. It does not fail on unsupported platforms and has been
known to work on many, many platforms since its creation in 2010.
Development
See CONTRIBUTING.md
License
See LICENSE file.
Change log
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v4.0.0 (2023-11-15)
Merged pull requests:
v3.0.0 (2022-09-27)
Merged pull requests:
- Rework for v3 #88 (ghoneycutt)
- bump stdlib to \< 9.0.0 #86 (jhoblitt)
v2.8.0 (2022-04-07)
Merged pull requests:
v2.7.0 (2018-12-19)
Merged pull requests:
- Add support for Puppet 5 & 6 #74 (Phil-Friderici)
- Test exported resources #61 (ghoneycutt)
v2.6.0 (2017-06-29)
Merged pull requests:
- Normalize testing #60 (ghoneycutt)
v2.5.0 (2017-02-27)
Merged pull requests:
- Support Puppet >= 4.9 #58 (Phil-Friderici)
v2.4.1 (2016-11-18)
Merged pull requests:
- Fix spec #56 (ghoneycutt)
- Use puppet lint v2 #55 (ghoneycutt)
v2.4.0 (2016-08-31)
Merged pull requests:
- Ruby231 #51 (ghoneycutt)
- Move comments to correct context in Gemfile #47 (Phil-Friderici)
v2.3.0 (2016-05-09)
Merged pull requests:
- Add puppetv4 #46 (ghoneycutt)
- Puppetv4 fixes #45 (anders-larsson)
v2.2.4 (2015-05-28)
Merged pull requests:
- Fix style warnings #37 (ghoneycutt)
v2.2.3 (2015-03-12)
Merged pull requests:
- Metadata and travis #31 (ghoneycutt)
- Changed outdated (by next puppet version) type-function to is_\<type> #30 (mannbach)
v2.2.2 (2015-02-28)
Merged pull requests:
- Fix for removing fqdn entry #26 (ghoneycutt)
v2.2.1 (2015-02-28)
Merged pull requests:
- Modernize travis #28 (ghoneycutt)
v2.2.0 (2015-01-08)
Merged pull requests:
v2.1.0 (2014-05-21)
Merged pull requests:
- Fix dupe fqdn #19 (ghoneycutt)
v2.0.1 (2014-04-26)
Merged pull requests:
- Fix error when setting enable_ipv4_localhost to false #15 (ghost)
- Gemfile to reflect that 2.7 support has been dropped #13 (ghoneycutt)
- Travis #12 (ghoneycutt)
- Support rspec-puppet v1.0.0 #11 (ghoneycutt)
v2.0.0 (2013-12-21)
Merged pull requests:
- Increase quality to 1.0.0 standards #10 (ghoneycutt)
- Host entries from hiera #9 (ghoneycutt)
- Add ability to add hosts #8 (ghost)
- Normalize testing #7 (anders-k-lindgren)
- Collect all #6 (ghoneycutt)
- Boolean fix merge #3 (jwennerberg)
- Add support for Debian/Ubuntu. #2 (jonathanbower)
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/host_core (>= 1.1.0 < 2.0.0)
- puppetlabs/stdlib (>= 8.0.0 < 10.0.0)
Copyright (C) 2010-2022 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.