cloud-init creates /etc/network/interfaces.d/50-cloud-init.cfg even if /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg present
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
New
|
Undecided
|
Unassigned | ||
curtin |
New
|
Undecided
|
Unassigned | ||
cloud-init (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Package: cloud-init 0.7.8-1-
The file /etc/network/
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
On a system with this file created:
# cat /etc/cloud/
network: {config: disabled}
cloud-init still ends up creating the 50-cloud-init.cfg file. opensnoop shows that cloud-init is definitely reading that 99-disable-
# opensnoop /etc/cloud/
Tracing open()s for filenames containing "/etc/cloud/
COMM PID FD FILE
cloud init 0x3 /etc/cloud/
....
I've been trying to follow the code logic, and I'm not seeing any check to see if the network configuration is set to disabled or not.
cloudinit/stages.py uses 'net.is_ disabled_ cfg()'.
I just verified on a fresh lxc container.
* boot system cloud.cfg. d/99-disable- network- config. cfg interfaces. d/50-cloud- init.cfg interfaces. d/50-cloud- init.cfg interfaces. d/50-cloud- init.cfg: No such file or directory g3705bb5- 0ubuntu1~ 16.04.3
* lxc exec x1
% echo "network: {config: disabled}" > /etc/cloud/
% rm /etc/network/
% reboot
* lxc exec x1
% cat /etc/network/
cat: /etc/network/
% dpkg-query --show cloud-init
cloud-init 0.7.8-1-
% grep "INFO.*disabled" /var/log/ cloud-init. log
Nov 10 02:07:59 xt1 [CLOUDINIT] stages.py[INFO]: network config is disabled by system_cfg
Nov 10 02:08:00 xt1 [CLOUDINIT] stages.py[INFO]: network config is disabled by system_cfg
So it seems not completely broken there.