diff options
-rw-r--r-- | dan/ele-calypso.yml | 6 | ||||
-rw-r--r-- | inventory/host_vars/ele-calypso.yml | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/dan/ele-calypso.yml b/dan/ele-calypso.yml index b0c143c1..62f65836 100644 --- a/dan/ele-calypso.yml +++ b/dan/ele-calypso.yml @@ -44,6 +44,12 @@ {% if vlan_iface %} iface {{ vlan_ifname }} inet static address {{ (vlan_iface | first).address }} + {% for route in vlan_iface[0].static_routes | default([]) %} + up /bin/ip route add {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }} + {% endfor %} + {% for route in vlan_iface[0].static_routes | default([]) | reverse %} + down /bin/ip route del {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }} + {% endfor %} {% else %} iface {{ vlan_ifname }} inet manual {% endif %} diff --git a/inventory/host_vars/ele-calypso.yml b/inventory/host_vars/ele-calypso.yml index 7047cd2a..8de1ebde 100644 --- a/inventory/host_vars/ele-calypso.yml +++ b/inventory/host_vars/ele-calypso.yml @@ -18,6 +18,9 @@ network: address: "{{ network_zones.mgmt.prefix | ansible.utils.ipaddr(network_zones.mgmt.offsets[inventory_hostname]) }}" - name: "enp3s0.{{ network_zones.emc.vlan }}" address: "{{ network_zones.emc.prefix | ansible.utils.ipaddr(network_zones.emc.offsets[inventory_hostname]) }}" + static_routes: + - destination: "{{ network_zones.cc_orpheum.prefix | ansible.utils.ipaddr(network_zones.cc_orpheum.offsets['ele-thetys']) | ansible.utils.ipaddr('address') }}" + gateway: "{{ network_zones.emc.gateway }}" vlans: enp3s0: - "{{ network_zones.mgmt.vlan }}" |