73. Host

Hosts data (/etc/hosts)

73.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

  • Deleted - Deleted hosts

  • 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

73.2. Global Functions

73.2.1. Export

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

Return value

  • map - autoinstallation settings

73.2.2. GetModified

Function which returns if the settings were modified

Return value

  • boolean - settings were modified

73.2.3. GetSystemHosts

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

Return value

  • list - of system hosts

73.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

73.2.5. Read

Read hosts settings

Return value

  • boolean - true if success

73.2.6. SetModified

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

Return value

  • void

73.2.7. Summary

Create summary

Return value

  • string - summary text

73.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

73.2.9. Write

Write hosts settings and apply changes

Return value

  • boolean - true if success

73.3. Global Variables

73.3.1. Deleted

Deleted hosts

73.3.2. 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

73.3.3. modified

Data was modified?

73.3.4. write_only

Only write configuration

73.4. Module Requirements

73.4.1. Module Imports

  • Hostname
  • String
  • Summary

73.4.2. Module Includes