Browse Source

Fix hostnames ordering fix if multiple addresses applies

tags/2016.12
Ales Komarek 8 years ago
parent
commit
c8548ed2a6
1 changed files with 2 additions and 6 deletions
  1. +2
    -6
      linux/network/host.sls

+ 2
- 6
linux/network/host.sls View File

- ip: {{ host.address }} - ip: {{ host.address }}
- names: {{ host.names }} - 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 before = host.names.1 + " " + host.names.0 %}
{%- set after = host.names.0 + " " + host.names.1 %} {%- 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 after = host.names.1 + " " + host.names.0 %} {%- set after = host.names.1 + " " + host.names.0 %}
{%- endif %} {%- endif %}


{%- if before is defined and after is defined %}

linux_host_{{ name }}_order_fix: linux_host_{{ name }}_order_fix:
module.run: module.run:
- name: file.replace - name: file.replace


{%- endif %} {%- endif %}


{%- endif %}

{%- endfor %} {%- endfor %}


{%- endif %} {%- endif %}

Loading…
Cancel
Save