Merge pull request #29 from obourdon/stacklight
Fixes for idempotence
diff --git a/linux/network/host.sls b/linux/network/host.sls
index d913c6f..6749350 100644
--- a/linux/network/host.sls
+++ b/linux/network/host.sls
@@ -28,6 +28,8 @@
- repl: {{ after }}
- watch:
- host: linux_host_{{ name }}
+ - onlyif:
+ - grep -q "{{ before }}" /etc/hosts
{%- endif %}
@@ -35,4 +37,4 @@
{%- endfor %}
-{%- endif %}
\ No newline at end of file
+{%- endif %}
diff --git a/linux/network/interface.sls b/linux/network/interface.sls
index 4b26750..6b6755b 100644
--- a/linux/network/interface.sls
+++ b/linux/network/interface.sls
@@ -88,6 +88,7 @@
- type: {{ interface.type }}
{%- if interface.address is defined %}
{%- if grains.os_family == 'Debian' %}
+ - unless: grep -q "iface {{ interface_name }} " /etc/network/interfaces
- proto: {{ interface.get('proto', 'static') }}
{% endif %}
{%- if grains.os_family == 'RedHat' %}