From 7c7b632fc882b719d417bf91abde6532b082eb50 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Fri, 10 May 2024 00:17:50 +0000 Subject: [PATCH] network: Add missing template --- roles/network/templates/nmconnection.j2 | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 roles/network/templates/nmconnection.j2 diff --git a/roles/network/templates/nmconnection.j2 b/roles/network/templates/nmconnection.j2 new file mode 100644 index 0000000..3e7797d --- /dev/null +++ b/roles/network/templates/nmconnection.j2 @@ -0,0 +1,42 @@ +[connection] +id={{ item.device }} +{% for line in interface_uuid.stdout_lines %} +{% if line.split()[0] == item.device %} +uuid={{ line.split()[1] }} +{% elif line.split()[2] == item.device %} +uuid={{ line.split()[1] }} +{% endif %} +{% endfor %} +type=ethernet +interface-name={{ item.device }} + +[ethernet] + +[ipv4] +{% if item.proto is not defined or item.proto == 'dhcp' %} +method=auto +{% elif item.proto == 'static' %} +method=manual +address1={{ item.ipaddr }}/{{ item.netmask }} +{% if item.gateway is defined %} +gateway={{ item.gateway }} +{% endif %} +{% elif item.proto == 'none' %} +method=disabled +{% endif %} +{% if item.nameservers is defined %} +dns={% for name in item.nameservers %}{{ name }};{% endfor %} +{% endif %} + +[ipv6] +addr-gen-mode=eui64 +{% if item.ip6addr is not defined or item.ip6addr == 'none' %} +method=disabled +{% elif item.ip6addr == 'auto' %} +method=auto +{% else %} +method=manual +address1={{ item.ip6addr }} +{% endif %} + +[proxy]