浏览代码

Fix hostnames ordering fix if multiple addresses applies

tags/2016.12
Ales Komarek 8 年前
父节点
当前提交
c8548ed2a6
共有 1 个文件被更改,包括 2 次插入6 次删除
  1. +2
    -6
      linux/network/host.sls

+ 2
- 6
linux/network/host.sls 查看文件

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

正在加载...
取消
保存