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

Add 'default_self' flag to parse_host_mac_ip_list().

This adds a new flag 'default_self' to the parse_host_mac_ip_list()
function.  When given, the IP address list will default to consist
of the hostname if neither any addresses nor an explicity "-" are
listed.  In combination with the 'resolve' flag, the hostname will
be resolved into numeric IP addresses; else it will behave as if the
hostname was surrounded by square brackets, and thus added to the
'ip_Name' element in the result.

This is useful when the IP addresses are provided outside of the
hostlist, e.g. in DNS, NIS or LDAP.  Users can then provide lists
of just the hostnames and the MAC addresses, have the hostnames
resolved into IP addresses, and generate e.g. DHCP config files
with numeric addresses in them.

Another potential use case, could be to generate /etc/hosts files
that effectively act as caches for DNS, allowing a node to do
hostname lookups of the most common names or addresses even if the
catalogue service is unavailable.
parent 8cea3e4c
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment