Page MenuHomeDevCentral

D2567.diff
No OneTemporary

D2567.diff

diff --git a/pillar/nodes/nodes.sls b/pillar/nodes/nodes.sls
--- a/pillar/nodes/nodes.sls
+++ b/pillar/nodes/nodes.sls
@@ -81,9 +81,10 @@
ipv4_gateway: 91.121.86.254
ipv4_ovh_failover: True
- private_interface: vmx1
- private_address: 172.27.27.1
- private_netmask: 255.255.255.0
+ private_interface:
+ device: vmx1
+ address: 172.27.27.1
+ netmask: 255.255.255.0
ipv6_tunnel: False
diff --git a/roles/core/network/ipv4.sls b/roles/core/network/ipv4.sls
--- a/roles/core/network/ipv4.sls
+++ b/roles/core/network/ipv4.sls
@@ -26,18 +26,6 @@
dhcp_required: {{ salt['node.has']('network:dhcp_required') }}
{% endif %}
-{% if grains['os_family'] == 'RedHat' %}
-{% if "private_interface" in network %}
-{% set interface = network['private_interface'] %}
-/etc/sysconfig/network-scripts/ifcfg-{{ interface['device'] }}:
- file.managed:
- - source: salt://roles/core/network/files/RedHat/ifcfg-private
- - template: jinja
- - context:
- interface: {{ interface }}
-{% endif %}
-{% endif %}
-
# -------------------------------------------------------------
# Routes
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/core/network/private.sls b/roles/core/network/private.sls
--- a/roles/core/network/private.sls
+++ b/roles/core/network/private.sls
@@ -13,6 +13,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% if salt['node.has']('network:private_interface') %}
+{% set interface = network['private_interface'] %}
{% if grains['os'] == 'FreeBSD' %}
/etc/rc.conf.d/netif/ipv4_{{ network['private_interface'] }}:
@@ -21,11 +22,20 @@
- makedirs: True
- template: jinja
- context:
- interface: {{ network['private_interface'] }}
- ipv4_address: {{ network['private_address'] }}
- ipv4_netmask: {{ network['private_netmask'] | default('255.255.255.0') }}
- ipv4_aliases: {{ salt['node.get_list']('network:private_aliases') }}
+ interface: {{ interface['device'] }}
+ ipv4_address: {{ interface['address'] }}
+ ipv4_netmask: {{ interface['netmask'] | default('255.255.255.0') }}
+ ipv4_aliases: {{ salt['node.get_list']('network:private_interface:aliases') }}
dhcp_required: False
{% endif %}
+{% if grains['os_family'] == 'RedHat' %}
+/etc/sysconfig/network-scripts/ifcfg-{{ interface['device'] }}:
+ file.managed:
+ - source: salt://roles/core/network/files/RedHat/ifcfg-private
+ - template: jinja
+ - context:
+ interface: {{ interface }}
+{% endif %}
+
{% endif %}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 12:54 (6 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2258484
Default Alt Text
D2567.diff (2 KB)

Event Timeline