Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cloud-init.postinst for maas preseed provisioning #5686

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

blackboxsw
Copy link
Collaborator

@blackboxsw blackboxsw commented Sep 10, 2024

Merge as separate commits

Proposed Commit Message

  • see separate commits

Functional change

fix(d/postinst): retain handle_preseed functions for MAAS provision

Commit cf13fd12 removed support for MAAS preseed functions from
debian/cloud-init.postinst which is the only operation which
allows MAAS to send preseed config to cloud-init.

Fixes GH-5685

Additional Context

#5685

The other functions in postinst that were removed by commit cf13fd1 were already version gated to be skipped on any recent supported LTS. So, the other dropped postinst functions in that commit do not need to be reverted. Just active MAAS preseed support utility functions.

Test Steps

Merge type

  • merge as separate commits from git command line
  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

Commit cf13fd1 removed support for MAAS preseed functions from
debian/cloud-init.postinst which is the only operation which
allows MAAS to send preseed config to cloud-init.

Fixes canonicalGH-5685
@holmanb
Copy link
Member

holmanb commented Sep 10, 2024

@blackboxsw looks good, but unit tests are failing

@@ -1,3 +1,11 @@
cloud-init (24.4~3+really24.3.1-0ubuntu2) oracular; urgency=medium
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would 24.4~4 make more sense here as this is devel?

Copy link
Collaborator Author

@blackboxsw blackboxsw Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering the same, but this is an ubuntu downstream packaging change just beyond the 24.4~3+really24.3.1 and into the development release still, so I'd think we would follow the ubuntu-specific version bump in devel series.

@blackboxsw
Copy link
Collaborator Author

@blackboxsw looks good, but unit tests are failing

Unable to reproduce this issue. tox -e py3 on this branch looks good, CI tests look good, only failure I'm seeing is Packaging tests on absent series file which landed in tip of main, but hasn't been new_upstream_snapshotted into this branch yet.

Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@blackboxsw
Copy link
Collaborator Author

I built and tested this release locally, uploaded to https://launchpad.net/~chad.smith/+archive/ubuntu/cloud-init-uploads for oracular and performed an upgrade test plus:

# provide debconf selections for cloud-init
echo -e "cloud-init cloud-init/maas-metadata-url string http://123\ncloud-init cloud-init/maas-metadata-credentials string a:b:c\ncloud-init cloud-init/local-cloud-config string #cloud-config\nlocal-hostname: doit\n" | dpkg-set-selections
#  apply debconf changes in noninteractive mode triggering postinst "configure" operation
dpkg-reconfigure cloud-init -f noninteractive
# validate proper files are created
root@dev-o:~# cat /etc/cloud/cloud.cfg.d/90_dpkg_maas.cfg 
# written by cloud-init debian package per preseed entries
# cloud-init/{maas-metadata-url,/maas-metadata-credentials}
datasource:
  MAAS:
    consumer_key: a
    metadata_url: http://123
    token_key: b
    token_secret: c
root@dev-o:~# cat /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
#cloud-config
local-hostname: doit

@blackboxsw
Copy link
Collaborator Author

Added a followup issue to get better integration coverage #5688

@blackboxsw blackboxsw merged commit 4eee43b into canonical:ubuntu/devel Sep 11, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants