Skip to content
Snippets Groups Projects
Commit d4cedd90 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Class & definition for managing /etc/hosts.

We here add one class and one definition for managing the contents
of /etc/hosts:

  networking::hostsfile                Base class
  networking::hostsfile::hostentries   Add host entries

The data structure that networking::hostsfile::hostentries wants,
is a hash with hostnames as keys, and another level of hash as
values.  The value hashes need in turn have a key named "ip", which
holds zero, one or more IP addresses for that host.  The intermediate
hash might seem overly convoluted, but we want to be able to use the
same data structure for generating /etc/hosts files and DHCP server
configs, where a MAC address is also wanted, and we will next add a
function for generating such a structure from plain text files.
parent f755132e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment