Page MenuHomeDevCentral

D3385.diff
No OneTemporary

D3385.diff

diff --git a/_modules/node.py b/_modules/node.py
--- a/_modules/node.py
+++ b/_modules/node.py
@@ -231,6 +231,18 @@
return "wwwroot/{1}/{0}".format(".".join(fqdn[0:-2]), ".".join(fqdn[-2:]))
+def has_interface_flag(flag, nodename=None):
+ interfaces = _get_property("network:interfaces", nodename, None)
+
+ return any(
+ [
+ flag in interface["flags"]
+ for interface in interfaces.values()
+ if "flags" in interface
+ ]
+ )
+
+
def get_ipv6_list():
"""
A function to get a list of IPv6, enclosed by [].
diff --git a/pillar/nodes/nodes.sls b/pillar/nodes/nodes.sls
--- a/pillar/nodes/nodes.sls
+++ b/pillar/nodes/nodes.sls
@@ -240,9 +240,9 @@
address: 2001:41d0:303:d971::517e:c0de
gateway: 2001:41d0:303:d9ff:ff:ff:ff:ff
prefix: 64
-
- fixes:
- hello_ipv6_ovh: True
+ flags:
+ - ipv4_ovh_failover
+ - hello_ipv6_ovh
ysul:
forest: nasqueron-dev
diff --git a/roles/core/network/ipv6_fixes.sls b/roles/core/network/ipv6_fixes.sls
--- a/roles/core/network/ipv6_fixes.sls
+++ b/roles/core/network/ipv6_fixes.sls
@@ -37,7 +37,7 @@
# announced.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-{% if salt['node.has']('fixes:hello_ipv6_ovh') %}
+{% if salt["node.has_interface_flag"]("hello_ipv6_ovh") %}
/usr/local/etc/cron.d/hello-ipv6:
file.managed:

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 04:26 (17 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2257153
Default Alt Text
D3385.diff (1 KB)

Event Timeline