Juju's MAAS bridging script needs to de-duplicate dns-* iface options

Bug #1536728 reported by Andrew McDermott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Andrew McDermott

Bug Description

When the bridge script renders an original /etc/network/interfaces file like:

  auto eth0
  iface eth0 inet static
      gateway 10.245.168.1
      address 10.245.168.11/21
      mtu 1500

  auto eth1
  iface eth1 inet static
      dns-nameservers 10.245.168.2
      gateway 10.245.168.1
      address 10.245.168.12/21
      mtu 1500

  dns-nameservers 192.168.1.1

into ->>>>>>>>>>>>>>>>>>>>>

  iface eth0 inet manual

  auto br-eth0
  iface br-eth0 inet static
      gateway 10.245.168.1
      address 10.245.168.11/21
      mtu 1500
      bridge_ports eth0

  iface eth1 inet manual

  auto br-eth1
  iface br-eth1 inet static
      dns-nameservers 10.245.168.2
      gateway 10.245.168.1
      address 10.245.168.12/21
      mtu 1500
      dns-nameservers 192.168.1.1
      bridge_ports eth1

the script needs to ensure that the dns-* options are de-duplicated and become a single line. This knowledge gained from our understanding and resolution to:

  https://bugs.launchpad.net/juju-core/+bug/1534795

The resolvconf(8) man page also spells this out:

     To add nameserver addresses, add a single line beginning with dns-name‐
     servers.

           dns-nameservers 192.168.1.254 8.8.8.8

     Note that one or more addresses can be given on this line, separated by
     spaces, and note the "s" at the end of the option name, in contrast
     with the resolv.conf(5) option name nameserver. Remember that in
     interfaces(5) each option can be used at most once per stanza.

Taking the 'iface br-eth1 inet static' example it should become:

  auto br-eth1
  iface br-eth1 inet static
      gateway 10.245.168.1
      address 10.245.168.12/21
      mtu 1500
      dns-nameservers 10.245.168.2 192.168.1.1
      bridge_ports eth1

This also holds true for dns-sortlist and dns-search options. This needs to be fixed in 1.25 and maas-spaces.

summary: - Juju's MAAS bridging script needs to de-duplicate dns-nameserver lines
+ Juju's MAAS bridging script needs to de-duplicate dns-* iface options
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.0-alpha2
Revision history for this message
Andrew McDermott (frobware) wrote :

Initial implementation and PR is in maas-spaces:

  https://github.com/juju/juju/pull/4189

Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-alpha2 → 2.0-beta1
Changed in juju-core:
status: Triaged → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta1 → none
milestone: none → 2.0-beta1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.