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

@@ -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 %}

Loading…
Cancel
Save