I tested the following fix suggestion on MAAS 2.3 (xenial image deployment) and it seems to bahave well with cloud-init, and avoids providing duplicate/conflicting apt_preferences to cloud-init via curtin
diff --git a/src/maasserver/compose_preseed.py b/src/maasserver/compose_preseed.py
index e15b3b2..2a41fbc 100644
--- a/src/maasserver/compose_preseed.py
+++ b/src/maasserver/compose_preseed.py
@@ -230,10 +230,9 @@ def compose_cloud_init_preseed(
# See bug 1087183 for details. "manage_etc_hosts": False, "apt_preserve_sources_list": True,
- # Prevent the node from requesting cloud-init data on every reboot.
- # This is done so a machine does not need to contact MAAS every time
- # it reboots.
- "manual_cache_clean": True,
+ # On ubuntu >= xenial (cloud-init 17.2) manual_cache_clean is no
+ # longer required. But, you might want to set it for < xenial
+ # "manual_cache_clean": True,
}
# This is used as preseed for a node that's been installed.
# This will allow cloud-init to be configured with reporting for
@@ -248,11 +247,6 @@ def compose_cloud_init_preseed( node.get_boot_rack_controller(), default_region_ip=default_region_ip)
if apt_proxy: config['apt_proxy'] = apt_proxy
- # Add APT configuration for new cloud-init (>= 0.7.7-17)
- config.update(
- get_archive_config(
- node=node, preserve_sources=False,
- default_region_ip=default_region_ip))
local_config_yaml = yaml.safe_dump(config)
# this is debconf escaping
I tested the following fix suggestion on MAAS 2.3 (xenial image deployment) and it seems to bahave well with cloud-init, and avoids providing duplicate/ conflicting apt_preferences to cloud-init via curtin
diff --git a/src/maasserve r/compose_ preseed. py b/src/maasserve r/compose_ preseed. py r/compose_ preseed. py r/compose_ preseed. py cloud_init_ preseed(
"manage_ etc_hosts" : False,
"apt_ preserve_ sources_ list": True, cache_clean" : True, cache_clean" : True, cloud_init_ preseed(
node. get_boot_ rack_controller (), default_ region_ ip=default_ region_ ip)
config[ 'apt_proxy' ] = apt_proxy sources= False, region_ ip=default_ region_ ip))
index e15b3b2..2a41fbc 100644
--- a/src/maasserve
+++ b/src/maasserve
@@ -230,10 +230,9 @@ def compose_
# See bug 1087183 for details.
- # Prevent the node from requesting cloud-init data on every reboot.
- # This is done so a machine does not need to contact MAAS every time
- # it reboots.
- "manual_
+ # On ubuntu >= xenial (cloud-init 17.2) manual_cache_clean is no
+ # longer required. But, you might want to set it for < xenial
+ # "manual_
}
# This is used as preseed for a node that's been installed.
# This will allow cloud-init to be configured with reporting for
@@ -248,11 +247,6 @@ def compose_
if apt_proxy:
- # Add APT configuration for new cloud-init (>= 0.7.7-17)
- config.update(
- get_archive_config(
- node=node, preserve_
- default_
local_ config_ yaml = yaml.safe_ dump(config)
# this is debconf escaping