Comment 12 for bug 1735950

Revision history for this message
Chad Smith (chad.smith) wrote :

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