86. Host

Hosts data (/etc/hosts)

86.1. Authors

  • Michal Svec <msvec@suse.cz>

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

86.3. Global Functions

86.3.1. Export

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

Return value

  • map - autoinstallation settings

86.3.2. GetModified

Function which returns if the settings were modified

Return value

  • boolean - settings were modified

86.3.3. GetSystemHosts

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

Return value

  • list - of system hosts

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

86.3.5. Read

Read hosts settings

Return value

  • boolean - true if success

86.3.6. SetModified

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

Return value

  • void

86.3.7. Summary

Create summary

Return value

  • string - summary text

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

86.3.9. Write

Write hosts settings and apply changes

Return value

  • boolean - true if success

86.4. Global Variables

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

86.4.2. modified

Data was modified?

86.4.3. write_only

Only write configuration

86.5. Module Requirements

86.5.1. Module Imports

  • Hostname
  • NetworkConfig
  • String
  • Summary

86.5.2. Module Includes

  • network/routines.ycp