The /etc/hosts file can be managed to contain definitions for specific hosts:
salt-master:
host.present:
- ip: 192.168.0.42
Or using the "names:" directive, you can put several names for the same IP. (Do not try one name with space-separated values).
server1:
host.present:
- ip: 192.168.0.42
- names:
- server1
- florida
NOTE: changing the IP or name(s) in the present() function does not cause an update to remove the old entry.
Ensure that the named host is absent
Ensures that the named host is present with the given ip