Files
Ansible-Bootstrap/roles/configuration/templates/network.j2

39 lines
990 B
Django/Jinja

[connection]
id=LAN-{{ idx }}
uuid={{ configuration_net_uuid }}
type=ethernet
autoconnect-priority=10
{% set iface = configuration_iface %}
{% if iface.name | default('') | string | length %}
interface-name={{ iface.name }}
{% else %}
{# Bind the first available ethernet by name glob, never a MAC: a clone with a new adapter/MAC stays networked (#12). #}
[match]
interface-name=en*;eth*;
{% endif %}
[ipv4]
{% set dns_list = configuration_dns_list %}
{% set search_list = configuration_dns_search %}
{% if iface.ip | default('') | string | length %}
address1={{ iface.ip }}/{{ iface.prefix }}{{ (',' ~ iface.gateway) if (iface.gateway | default('') | string | length) else '' }}
method=manual
{% else %}
method=auto
{% endif %}
{% if idx | int == 0 and dns_list %}
dns={{ dns_list | join(';') }};
ignore-auto-dns=true
{% endif %}
{% if idx | int == 0 and search_list %}
dns-search={{ search_list | join(';') }};
{% endif %}
[ipv6]
addr-gen-mode=stable-privacy
method=disabled
[proxy]