-
- Downloads
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.
Showing
- manifests/hostsfile.pp 23 additions, 0 deletionsmanifests/hostsfile.pp
- manifests/hostsfile/hostentries.pp 47 additions, 0 deletionsmanifests/hostsfile/hostentries.pp
- templates/hosts.txt-base.erb 8 additions, 0 deletionstemplates/hosts.txt-base.erb
- templates/hosts.txt-sub.erb 33 additions, 0 deletionstemplates/hosts.txt-sub.erb
Loading
Please register or sign in to comment