diff options
author | clarkzjw <[email protected]> | 2023-02-08 00:40:09 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2023-02-08 00:40:09 -0800 |
commit | 1204730924436ef9e1c7c49c9557837f9a5ed0e8 (patch) | |
tree | 129d79dfd11245751cee6d4082ff5d2f6e941610 /ansible/roles/network/templates | |
parent | 9635ac4dedf69de5bff65785bcc16bef80b52d75 (diff) | |
download | mail-1204730924436ef9e1c7c49c9557837f9a5ed0e8.tar.gz |
Diffstat (limited to 'ansible/roles/network/templates')
-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 %} | ||