diff options
Diffstat (limited to 'roles/network/templates')
| -rw-r--r-- | roles/network/templates/bridge.nmconnection.j2 | 29 | ||||
| -rw-r--r-- | roles/network/templates/eth0-connection.nmconnection.j2 | 12 |
2 files changed, 39 insertions, 2 deletions
diff --git a/roles/network/templates/bridge.nmconnection.j2 b/roles/network/templates/bridge.nmconnection.j2 new file mode 100644 index 00000000..2e8bf23c --- /dev/null +++ b/roles/network/templates/bridge.nmconnection.j2 @@ -0,0 +1,29 @@ +[connection] +id={{ network_bridge }} +type=bridge +interface-name={{ network_bridge }} +autoconnect=true + +[bridge] +stp=false + +[ipv4] +method=manual +addresses={{ network_ipv4_address }}/{{ network_ipv4_prefix | default(24) }} +gateway={{ network_ipv4_gateway }} +{% if network_ipv4_dns is defined %} +dns={{ network_ipv4_dns }} +{% endif %} + +[ipv6] +addr-gen-mode=default +{% if network_ipv6_address is defined %} +method=manual +addresses={{ network_ipv6_address }} +gateway={{ network_ipv6_gateway }} +{% if network_ipv6_dns is defined %} +dns={{ network_ipv6_dns }} +{% endif %} +{% else %} +method=disabled +{% endif %} diff --git a/roles/network/templates/eth0-connection.nmconnection.j2 b/roles/network/templates/eth0-connection.nmconnection.j2 index 666b0360..6a6481c4 100644 --- a/roles/network/templates/eth0-connection.nmconnection.j2 +++ b/roles/network/templates/eth0-connection.nmconnection.j2 @@ -2,12 +2,18 @@ id=ethernet type=ethernet autoconnect=true +{% if network_bridge is defined %} +controller={{ network_bridge }} +port-type=bridge +{% endif %} [ethernet] cloned-mac-address=permanent [ipv4] -{% if network_ipv4_address is defined %} +{% if network_bridge is defined %} +method=disabled +{% elif network_ipv4_address is defined %} method=manual addresses={{ network_ipv4_address }} gateway={{ network_ipv4_gateway }} @@ -20,7 +26,9 @@ method=auto [ipv6] addr-gen-mode=default -{% if network_ipv6_address is defined %} +{% if network_bridge is defined %} +method=disabled +{% elif network_ipv6_address is defined %} method=manual addresses={{ network_ipv6_address }} gateway={{ network_ipv6_gateway }} |
