82. Host

Hosts data (/etc/hosts)

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

82.2. Global Functions

82.2.1. Export

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

Return value

  • map - autoinstallation settings

82.2.2. GetModified

Function which returns if the settings were modified

Return value

  • boolean - settings were modified

82.2.3. GetSystemHosts

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

Return value

  • list - of system hosts

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

82.2.5. Read

Read hosts settings

Return value

  • boolean - true if success

82.2.6. SetModified

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

Return value

  • void

82.2.7. Summary

Create summary

Return value

  • string - summary text

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

82.2.9. Write

Write hosts settings and apply changes

Return value

  • boolean - true if success

82.3. Global Variables

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

82.3.2. modified

Data was modified?

82.3.3. write_only

Only write configuration

82.4. Module Requirements

82.4.1. Module Imports

  • Hostname
  • String
  • Summary

82.4.2. Module Includes

  • network/routines.ycp