forked from bennojoy/network_interface
-
Notifications
You must be signed in to change notification settings - Fork 4
/
bond_Debian.j2
43 lines (41 loc) · 1.27 KB
/
bond_Debian.j2
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
37
38
39
40
41
42
43
auto {{ item.device }}
{% if item.bootproto == 'static' %}
iface {{ item.device }} inet static
{% if item.address is defined %}
address {{ item.address }}
{% endif %}
{% if item.netmask is defined %}
netmask {{ item.netmask }}
{% endif %}
{% if item.gateway is defined %}
gateway {{ item.gateway }}
{% endif %}
{% if item.bond_mode is defined %}
bond-mode {{ item.bond_mode }}
{% endif %}
bond-miimon {{ item.bond_miimon|default(100) }}
{% if item.bond_slaves is defined and item.bond_mode == 'active-backup' %}
bond-slaves none
{% endif %}
{% if item.bond_slaves is defined and item.bond_mode == '802.3ad' %}
bond-slaves {{ item.bond_slaves|join(' ') }}
{% endif %}
{% endif %}
{% if item.bootproto == 'dhcp' %}
iface {{ item.device }} inet dhcp
{% if item.bond_mode is defined %}
bond-mode {{ item.bond_mode }}
{% endif %}
bond-miimon {{ item.bond_miimon|default(100) }}
{% if item.bond_slaves is defined and item.bond_mode == 'active-backup' %}
bond-slaves none
{% endif %}
{% if item.bond_slaves is defined and item.bond_mode == '802.3ad' %}
bond-slaves {{ item.bond_slaves|join(' ') }}
{% endif %}
{% endif %}
{% if item.route is defined %}
{% for i in item.route %}
up route add -net {{ i.network }} netmask {{ i.netmask }} gw {{ i.gateway }} dev {{ item.device }}
{% endfor %}
{% endif %}