Comment 0 for bug 2088179

Revision history for this message
Nobuto Murata (nobuto) wrote :

1:3.4.5-14373-g.ab434d5402-0ubuntu1~22.04.1

Considering a situation where admins, users, or external automation to MAAS (e.g. Juju/Charms) modifies /etc/hosts after the initial provisioning by MAAS. Those changes will be lost immediately after a reboot.

By looking to the detail, the deployed hosts have the following:

[/etc/cloud/cloud.cfg.d/90_dpkg_local_cloud_config.cfg]
# written by cloud-init debian package per preseed entry
# cloud-init/local-cloud-config
manage_etc_hosts: true
manual_cache_clean: true
reporting:
  maas:
    consumer_key: Kmc8Wz45YnfQ2nT6EG
    endpoint: http://192.168.151.1:5248/MAAS/metadata/status/fhq6qa
    token_key: LDpwjgW5DVMPCdZRrH
    token_secret: 9neUuyUPdBwamfCw4JBLjvH86TAnQvDf
    type: webhook

And the explicit manage_etc_hosts=true (non default in cloud-init) is coming from MAAS generated curtin config.
https://cloudinit.readthedocs.io/en/latest/reference/yaml_examples/update_etc_hosts.html

[/root/curtin-install-cfg.yaml]
debconf_selections:
  grub2: grub2 grub2/update_nvram boolean false
  maas: 'cloud-init cloud-init/datasources multiselect MAAS

    cloud-init cloud-init/maas-metadata-url string http://192.168.151.1:5248/MAAS/metadata/

    cloud-init cloud-init/maas-metadata-credentials string oauth_consumer_key=Kmc8Wz45YnfQ2nT6EG&oauth_token_key=LDpwjgW5DVMPCdZRrH&oauth_token_secret=9neUuyUPdBwamfCw4JBLjvH86TAnQvDf

    cloud-init cloud-init/local-cloud-config string manage_etc_hosts: true\nmanual_cache_clean:
    true\nreporting:\n maas:\n consumer_key: Kmc8Wz45YnfQ2nT6EG\n endpoint:
    http://192.168.151.1:5248/MAAS/metadata/status/fhq6qa\n token_key: LDpwjgW5DVMPCdZRrH\n token_secret:
    9neUuyUPdBwamfCw4JBLjvH86TAnQvDf\n type: webhook\n

    '