openstack-ansible-nspawn_hosts/templates/systemd-nspawn-mv.network.j2

24 lines
531 B
Django/Jinja

# {{ ansible_managed }}
[Match]
Name={{ 'mv-' + item.value.bridge.split('br-')[-1] }}
[Network]
DHCP=no
IPForward=yes
IPMasquerade=yes
{% if item.value.gateway is defined %}
Gateway={{ item.value.gateway }}
{% endif %}
{% if item.value.enable_dhcp | default(false) | bool %}
{% if item.value.address is defined %}
[Address]
{% set addr_cidr = (item.value.address | string + '/' + item.value.netmask | string) | ipaddr('prefix') %}
Address={{ item.value.address }}/{{ addr_cidr }}
{% endif %}
{% endif %}
[Link]
ARP=yes