diff options
Diffstat (limited to 'ansible/roles/network/templates/network')
-rw-r--r-- | ansible/roles/network/templates/network/custom.link | 6 | ||||
-rw-r--r-- | ansible/roles/network/templates/network/custom.network | 38 |
2 files changed, 44 insertions, 0 deletions
diff --git a/ansible/roles/network/templates/network/custom.link b/ansible/roles/network/templates/network/custom.link new file mode 100644 index 0000000..e3bc5a8 --- /dev/null +++ b/ansible/roles/network/templates/network/custom.link | |||
@@ -0,0 +1,6 @@ | |||
1 | [Match] | ||
2 | OriginalName={{ network.ethernets.interface }} | ||
3 | |||
4 | [Link] | ||
5 | WakeOnLan=off | ||
6 | MACAddress={{ network.ethernets.macaddress }} | ||
diff --git a/ansible/roles/network/templates/network/custom.network b/ansible/roles/network/templates/network/custom.network new file mode 100644 index 0000000..5a8b74e --- /dev/null +++ b/ansible/roles/network/templates/network/custom.network | |||
@@ -0,0 +1,38 @@ | |||
1 | [Match] | ||
2 | Name={{ network.ethernets.interface }} | ||
3 | |||
4 | #{% for net in network.ethernets.networks %} | ||
5 | #[Network] | ||
6 | #Address={{ net.subnet }} | ||
7 | #{% if net.gateway is defined %} | ||
8 | #Gateway={{ net.gateway }} | ||
9 | #{% endif %} | ||
10 | # | ||
11 | #{% endfor %} | ||
12 | |||
13 | |||
14 | {% for addr in network.ethernets.addresses %} | ||
15 | [Address] | ||
16 | Address={{ addr }} | ||
17 | |||
18 | {% endfor %} | ||
19 | |||
20 | {% for net in network.ethernets.networks %} | ||
21 | [Network] | ||
22 | Address={{ net.subnet }} | ||
23 | {% if net.gateway is defined %} | ||
24 | Gateway={{ net.gateway }} | ||
25 | {% endif %} | ||
26 | |||
27 | {% endfor %} | ||
28 | |||
29 | |||
30 | {% for route in network.ethernets.routes %} | ||
31 | [Route] | ||
32 | Destination={{ route.to }} | ||
33 | Gateway={{ route.via }} | ||
34 | {% if route['on-link'] %} | ||
35 | GatewayOnlink=true | ||
36 | {% endif %} | ||
37 | |||
38 | {% endfor %} | ||