Skip to content
Snippets Groups Projects
Thomas Bellman's avatar
Thomas Bellman authored
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.
d4cedd90
History
Name Last commit Last update