|
|
@@ -10,9 +10,9 @@ linux_host_{{ name }}: |
|
|
|
- ip: {{ host.address }} |
|
|
|
- names: {{ host.names }} |
|
|
|
|
|
|
|
{%- if host.address in grains.ipv4 %} |
|
|
|
{%- if host.address in grains.ipv4 and host.names|length > 1 %} |
|
|
|
|
|
|
|
{%- if host.names|length > 1 and host.names.1 in host.names.0 %} |
|
|
|
{%- if host.names.1 in host.names.0 %} |
|
|
|
{%- set before = host.names.1 + " " + host.names.0 %} |
|
|
|
{%- set after = host.names.0 + " " + host.names.1 %} |
|
|
|
{%- elif host.names.0 in host.names.1 %} |
|
|
@@ -20,8 +20,6 @@ linux_host_{{ name }}: |
|
|
|
{%- set after = host.names.1 + " " + host.names.0 %} |
|
|
|
{%- endif %} |
|
|
|
|
|
|
|
{%- if before is defined and after is defined %} |
|
|
|
|
|
|
|
linux_host_{{ name }}_order_fix: |
|
|
|
module.run: |
|
|
|
- name: file.replace |
|
|
@@ -35,8 +33,6 @@ linux_host_{{ name }}_order_fix: |
|
|
|
|
|
|
|
{%- endif %} |
|
|
|
|
|
|
|
{%- endif %} |
|
|
|
|
|
|
|
{%- endfor %} |
|
|
|
|
|
|
|
{%- endif %} |