#jinja2:lstrip_blocks: True
---
network:
  ethernets:
    renderer: NetworkManager
    public_adapter:
      accept-ra: false
    {% if not networks[0].dhcp4%}
      addresses:
        - {{ networks[0].address }}/24
      routes:
        - to: default
          via: {{ networks[0].gateway }}
    {% endif %}
      dhcp-identifier: mac
      dhcp4: {{ networks[0].dhcp4 }}
      dhcp6: {{ networks[0].dhcp6 }}
      match:
        macaddress: {{ macaddress.stdout }}
      nameservers:
        addresses:
          - {{ networks[0].dns[0]['nameserver'] }}
          - {{ networks[0].dns[1]['nameserver'] }}
      set-name: public_adapter
  version: 2