0
0
mirror of https://github.com/saltstack-formulas/openssh-formula.git synced 2024-11-28 03:28:09 +01:00

known_hosts: sort IP addresses

in order to prevent unnecessary changes due to
random ordering of dig results.
This commit is contained in:
Alexander Weidinger 2017-02-23 03:59:37 +01:00
parent 678cc9066c
commit 70461403cb

View File

@ -22,7 +22,7 @@
{%- set ip4 = salt['dig.A'](host) -%}
{%- set ip6 = salt['dig.AAAA'](host) -%}
{%- set names = [host_names.get(host, host)] -%}
{%- for ip in ip4 + ip6 -%}
{%- for ip in (ip4 + ip6)|sort -%}
{%- do names.append(ip) -%}
{%- for alias in aliases_ips.get(ip, []) -%}
{%- if alias not in names -%}