75. Host

Hosts data (/etc/hosts)

75.1. Summary of Module Globals

List of Global Functions

  • Export - Dump the Hosts settings to a map, for autoinstallation use.

  • GetModified - Function which returns if the settings were modified

  • GetSystemHosts - Return "system" predefined hosts (should be present all the time)

  • Import - Get all the Hosts configuration from a map. When called by hosts_auto (preparing autoinstallation data) the map may be empty.

  • Read - Read hosts settings

  • SetModified - Function sets internal variable, which indicates, that any settings were modified, to "true"

  • Summary - Create summary

  • Update - Update hosts according to the current hostname (only one hostname, assigned to all IPs)

  • Write - Write hosts settings and apply changes

List of Global Variables

  • hosts - All hosts See hosts(5) keys: IPs, (But #35671 suggests that repeating IPs is valid) values: names, the first one is the canonical one

  • modified - Data was modified?

  • write_only - Only write configuration

75.2. Global Functions

75.2.1. Export

Dump the Hosts settings to a map, for autoinstallation use.

Return value

  • map - autoinstallation settings

75.2.2. GetModified

Function which returns if the settings were modified

Return value

  • boolean - settings were modified

75.2.3. GetSystemHosts

Return "system" predefined hosts (should be present all the time)

Return value

  • list - of system hosts

75.2.4. Import

Get all the Hosts configuration from a map. When called by hosts_auto (preparing autoinstallation data) the map may be empty.

Function parameters

  • map settings

Return value

  • boolean - true if success

75.2.5. Read

Read hosts settings

Return value

  • boolean - true if success

75.2.6. SetModified

Function sets internal variable, which indicates, that any settings were modified, to "true"

Return value

  • void

75.2.7. Summary

Create summary

Return value

  • string - summary text

75.2.8. Update

Update hosts according to the current hostname (only one hostname, assigned to all IPs)

Function parameters

  • string oldhn

  • string newhn

  • list<string> iplist

Return value

  • boolean - true if success

75.2.9. Write

Write hosts settings and apply changes

Return value

  • boolean - true if success

75.3. Global Variables

75.3.1. hosts

All hosts See hosts(5) keys: IPs, (But #35671 suggests that repeating IPs is valid) values: names, the first one is the canonical one

75.3.2. modified

Data was modified?

75.3.3. write_only

Only write configuration

75.4. Module Requirements

75.4.1. Module Imports

  • Hostname
  • String
  • Summary

75.4.2. Module Includes