Merge ~rmccabe/cloud-init:bug1693251 into cloud-init:master
Status: | Merged |
---|---|
Merged at revision: | 67bab5bb804e2346673430868935f6bbcdb88f13 |
Proposed branch: | ~rmccabe/cloud-init:bug1693251 |
Merge into: | cloud-init:master |
Diff against target: |
132 lines (+69/-0) 3 files modified
cloudinit/distros/parsers/networkmanager_conf.py (+23/-0) cloudinit/net/sysconfig.py (+25/-0) tests/unittests/test_net.py (+21/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Scott Moser | Approve | ||
Lars Kellogg-Stedman (community) | Approve | ||
Server Team CI bot | continuous-integration | Approve | |
Review via email: mp+325325@code.launchpad.net |
Description of the change
In cases where the config json specifies nameserver entries, NetworkManager, if enabled, will clobber the /etc/resolv.conf that cloud-init has produced, which can break dns. If at least one interface is configured for dhcp, you might end up with a resolv.conf that doesn't function as intended, and if you don't have any interfaces that get dns from dhcp, NetworkManager could clobber resolv.conf with an empty file.
This patch adds a mechanism for dropping additional configuration into /etc/NetworkMan
This patch only writes out that configuration file if necessary (as opposed to creating an empty file when there is no config needed). I wasn't sure which was preferred, so if that's not ideal, I could write out the empty file for consistency.
This patch will also write that config "(dns=none") out, too, for the specific problem noted in #1693251
LP: #1693251
PASSED: Continuous integration, rev:7a49497502a ad683297f36666c 4d025a66330cc4 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 489/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- amd64/489 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- arm64/489 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- ppc64el/ 489 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- s390x/489 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=vm- i386/489
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 489/rebuild
https:/