From 1204730924436ef9e1c7c49c9557837f9a5ed0e8 Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Wed, 8 Feb 2023 00:40:09 -0800 Subject: fork https://github.com/mattsta/mailweb --- .../roles/network/templates/network/custom.link | 6 ++++ .../roles/network/templates/network/custom.network | 38 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 ansible/roles/network/templates/network/custom.link create mode 100644 ansible/roles/network/templates/network/custom.network (limited to 'ansible/roles/network/templates') 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 @@ +[Match] +OriginalName={{ network.ethernets.interface }} + +[Link] +WakeOnLan=off +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 @@ +[Match] +Name={{ network.ethernets.interface }} + +#{% for net in network.ethernets.networks %} +#[Network] +#Address={{ net.subnet }} +#{% if net.gateway is defined %} +#Gateway={{ net.gateway }} +#{% endif %} +# +#{% endfor %} + + +{% for addr in network.ethernets.addresses %} +[Address] +Address={{ addr }} + +{% endfor %} + +{% for net in network.ethernets.networks %} +[Network] +Address={{ net.subnet }} +{% if net.gateway is defined %} +Gateway={{ net.gateway }} +{% endif %} + +{% endfor %} + + +{% for route in network.ethernets.routes %} +[Route] +Destination={{ route.to }} +Gateway={{ route.via }} +{% if route['on-link'] %} +GatewayOnlink=true +{% endif %} + +{% endfor %} -- cgit v1.2.3