{#- vim: syntax=jinja -#} {%- from "linux/map.jinja" import network with context -%} # hosts(1) file managed by salt-minion(1) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN {%- set hosts = { '127.0.0.1': [ 'localhost' ], '127.0.1.1': [ network.fqdn|default(grains.fqdn), network.hostname|default(grains.nodename) ], '::1': [ 'localhost', 'ip6-localhost', 'ip6-loopback' ], 'ff02::1': [ 'ip6-allnodes' ], 'ff02::2': [ 'ip6-allrouters' ], } -%} {%- for name, host in network.host.iteritems() -%} {%- do hosts.update({host.address: host.names}) -%} {%- endfor %} {% for address, entries in hosts|dictsort %} {{ address }} {{ entries|join(' ') }} {%- endfor %}