summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2
blob: 3eddce45b3f9b4e07102c09d7dbaa9c61776f52f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# {{ ansible_managed }}

# Physical interface
{% if item.bridge_ports is not defined %}
auto {{ item.name }}
iface {{ item.name }} inet manual
{% if item.vlan_id is defined %}
    vlan-raw-device {{ item.name|replace('.' ~ item.vlan_id, '') }}
{% endif %}

{% else %}
auto {{ item.name }}
iface {{ item.name }} inet static
    bridge_stp off
    bridge_waitport 0
    bridge_fd 0
    bridge_ports {{ item.bridge_ports }}
{% if item.name == 'br-vlan' %}
    # Create veth pair, don't bomb if already exists
    pre-up ip link add br-vlan-veth type veth peer name eth12 || true
    # Set both ends UP
    pre-up ip link set br-vlan-veth up
    pre-up ip link set eth12 up
    # Delete veth pair on DOWN
    post-down ip link del br-vlan-veth || true
    bridge_ports br-vlan-veth
{% endif %}
{% if item.network is defined %}
    address {{ item.network.address | ipaddr('address') }}
    netmask {{ item.network.address | ipaddr('netmask') }}
{% endif %}
{% if item.network is defined and item.network.gateway is defined %}
    gateway {{ item.network.gateway | ipaddr('address') }}
{% endif %}

{% endif %}