Comment 6 for bug 1750884

Revision history for this message
Scott Moser (smoser) wrote :

MAAS is sending a "global" nameserver, and a ethernet device on a bridge.
cloud-init is rendering that nameserver onto the ethernet device rather
than on the bridge or as a "global" entry.

$ cat my.yaml
network:
  config: [
   {"id": "enp0s25", "type": "physical", "name": "enp0s25",
    "mac_address": "b8:ae:ed:7d:16:d0", "mtu": 1500,
    "subnets": [{"type": "manual"}]},
   {"id": "br0", "type": "bridge", "name": "br0",
    "mac_address": "b8:ae:ed:7d:16:d0", "bridge_interfaces": ["enp0s25"],
    "mtu": 1500, "params": {'bridge_fd': 15, 'bridge_stp': 0},
    "subnets": [
       {"type": "static", "address": "10.90.90.4/24", "dns_nameservers": [],
        "gateway": "10.90.90.1"}
     ]},
   {"type": "nameserver", "address": ["10.90.90.1"],
    "search": ["maaslab", "maas"]},
  ]
  version: 1

$ PYTHONPATH=$PWD python3 ./tools/net-convert.py \
   --network-data=my.yaml --kind=yaml --output-kind=netplan --directory=out.d

$ cat out.d/etc/netplan/50-cloud-init.yaml

network:
    version: 2
    ethernets:
        enp0s25:
            match:
                macaddress: b8:ae:ed:7d:16:d0
            mtu: 1500
            nameservers:
                addresses:
                - 10.90.90.1
                search:
                - maaslab
                - maas
            set-name: enp0s25
    bridges:
        br0:
            addresses:
            - 10.90.90.4/24
            gateway4: 10.90.90.1
            interfaces:
            - enp0s25
            parameters:
                forward-delay: 15
                stp: false