Avoid ifup run if noifupdown is turned on
Take into account the noifupdown option for all
cmd.run states with explicit ifup call as well.
Change-Id: Ibd3021da9bf8df7d2fae455384dfad65c5e46432
Closes-Bug: PROD-26462
diff --git a/linux/network/dpdk.sls b/linux/network/dpdk.sls
index c400831..7c76803 100644
--- a/linux/network/dpdk.sls
+++ b/linux/network/dpdk.sls
@@ -176,6 +176,9 @@
dpdk_ovs_bridge_up_{{ interface_name }}:
cmd.run:
- name: ifup {{ interface_name }}
+ {%- if network.noifupdown|d(false) or interface.noifupdown|d(false) %}
+ - onlyif: /bin/false
+ {%- endif %}
- require:
- file: dpdk_ovs_bridge_{{ interface_name }}
diff --git a/linux/network/interface.sls b/linux/network/interface.sls
index db6cd9f..395b938 100644
--- a/linux/network/interface.sls
+++ b/linux/network/interface.sls
@@ -137,7 +137,12 @@
ovs_bridge_up_{{ interface_name }}:
cmd.run:
- - name: ifup {{ interface_name }}
+ - name: ifup --ignore-errors {{ interface_name }}
+ {%- if network.noifupdown|d(false) or interface.noifupdown|d(false) %}
+ - onlyif: /bin/false
+ {%- else %}
+ - unless: grep -qFx up /sys/class/net/{{ interface_name }}/operstate
+ {%- endif %}
- require:
- file: ovs_bridge_{{ interface_name }}
- file: linux_interfaces_final_include
@@ -201,6 +206,9 @@
ovs_port_up_{{ interface_name }}:
cmd.run:
- name: ifup {{ interface_name }}
+ {%- if network.noifupdown|d(false) or interface.noifupdown|d(false) %}
+ - onlyif: /bin/false
+ {%- endif %}
- require:
- file: ovs_port_{{ interface_name }}
- openvswitch_bridge: ovs_bridge_{{ interface.bridge }}_present