|
|
|
|
|
|
|
|
|
|
|
|
|
|
{%- if host.names is defined %} |
|
|
{%- if host.names is defined %} |
|
|
|
|
|
|
|
|
|
|
|
{%- if host.get('enabled', True) %} |
|
|
|
|
|
|
|
|
linux_host_{{ name }}: |
|
|
linux_host_{{ name }}: |
|
|
host.present: |
|
|
host.present: |
|
|
- ip: {{ host.address }} |
|
|
- ip: {{ host.address }} |
|
|
|
|
|
|
|
|
{%- if host.address in grains.ipv4 and host.names|length > 1 %} |
|
|
{%- if host.address in grains.ipv4 and host.names|length > 1 %} |
|
|
|
|
|
|
|
|
{%- if 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 %} |
|
|
|
|
|
|
|
|
{%- set before = host.names.1 + " " + host.names.0 %} |
|
|
|
|
|
{%- set after = host.names.0 + " " + host.names.1 %} |
|
|
{%- elif host.names.0 in host.names.1 %} |
|
|
{%- elif host.names.0 in host.names.1 %} |
|
|
{%- set before = host.names.0 + " " + host.names.1 %} |
|
|
|
|
|
{%- set after = host.names.1 + " " + host.names.0 %} |
|
|
|
|
|
|
|
|
{%- set before = host.names.0 + " " + host.names.1 %} |
|
|
|
|
|
{%- set after = host.names.1 + " " + host.names.0 %} |
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
|
|
|
|
|
|
linux_host_{{ name }}_order_fix: |
|
|
linux_host_{{ name }}_order_fix: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
|
|
|
|
|
|
|
|
|
{%- else %} |
|
|
|
|
|
|
|
|
|
|
|
linux_host_{{ name }}_absent: |
|
|
|
|
|
host.absent: |
|
|
|
|
|
- ip: {{ host.address }} |
|
|
|
|
|
- names: {{ host.names }} |
|
|
|
|
|
|
|
|
|
|
|
{%- endif %} |
|
|
|
|
|
|
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
|
|
|
|
|
|
{%- endfor %} |
|
|
{%- endfor %} |