Saltstack Official Linux Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
794B

  1. {#-
  2. vim: syntax=jinja
  3. -#}
  4. {%- from "linux/map.jinja" import network with context -%}
  5. # hosts(1) file managed by salt-minion(1)
  6. # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
  7. {%- set hosts = {
  8. '127.0.0.1': [
  9. 'localhost'
  10. ],
  11. '127.0.1.1': [
  12. network.fqdn|default(grains.fqdn),
  13. network.hostname|default(grains.nodename)
  14. ],
  15. '::1': [
  16. 'localhost',
  17. 'ip6-localhost',
  18. 'ip6-loopback'
  19. ],
  20. 'ff02::1': [
  21. 'ip6-allnodes'
  22. ],
  23. 'ff02::2': [
  24. 'ip6-allrouters'
  25. ],
  26. } -%}
  27. {%- for name, host in network.host.iteritems() -%}
  28. {%- do hosts.update({host.address: host.names}) -%}
  29. {%- endfor %}
  30. {% for address, entries in hosts|dictsort %}
  31. {{ address }} {{ entries|join(' ') }}
  32. {%- endfor %}