Skip to content

manager: drop invalid cloud-init network key - #105

Merged
berendt merged 1 commit into
mainfrom
fix-cloud-init-network-schema-warning
May 26, 2026
Merged

berendt merged 1 commit into
mainfrom
fix-cloud-init-network-schema-warning

Conversation

@ideaship

Copy link
Copy Markdown
Contributor

Summary

  • Remove the top-level network: config: disabled stanza from the
    cloud-config user-data in testbed-default/manager.tf.
  • Cloud-init 24.x on Ubuntu 24.04 no longer accepts network as a
    valid user-data module key and rejects the document during schema
    validation (cloud-config failed schema validation!), causing
    cloud-init status to exit with code 2.
  • The stanza is redundant: the same user-data already disables
    cloud-init network configuration via a runcmd that writes
    /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg.

Test plan

  • make manager provisions a manager VM on Ubuntu 24.04 / cloud-init 24.x
  • /var/log/cloud-init.log no longer contains
    schema.py[WARNING]: cloud-config failed schema validation!
  • cloud-init status exits 0 (not 2)
  • /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg is still
    written by runcmd, so cloud-init network configuration remains
    disabled

🤖 Generated with Claude Code

The cloud-config user-data in testbed-default/manager.tf set a
top-level `network: config: disabled` key. Cloud-init 24.x on
Ubuntu 24.04 no longer accepts `network` as a valid user-data
module key and rejects the document during schema validation:

  schema.py[WARNING]: cloud-config failed schema validation!

This causes `cloud-init status` to report extended_status
"degraded done" and to exit with code 2 instead of 0, which can
break callers that treat a non-zero exit as a hard failure.

The stanza is also redundant: the same user-data block already
writes a dropin via runcmd that disables cloud-init network
configuration permanently:

  echo 'network: {config: disabled}' \
      > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

The dropin achieves the same effect through a supported
mechanism, so the invalid top-level key can simply be removed.

AI-assisted: Claude Code
Signed-off-by: Roger Luethi <luethi@osism.tech>
@ideaship
ideaship marked this pull request as ready for review May 25, 2026 20:16
@ideaship
ideaship requested a review from berendt May 25, 2026 20:16
@ideaship ideaship moved this from Ready to In review in Human Board May 25, 2026
@berendt

berendt commented May 26, 2026

Copy link
Copy Markdown
Member

According to the docs this is still valid: https://docs.cloud-init.io/en/latest/reference/network-config.html#disabling-network-configuration

In the combined cloud-init configuration dictionary, merged from /etc/cloud/cloud.cfg and /etc/cloud/cloud.cfg.d/*:

network:
  config: disabled

I think it's okay to remove it because of the redundant /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg file.

@ideaship

Copy link
Copy Markdown
Contributor Author

The docs you linked seem a bit unclear on whether or not user-data can be used to disable network config, but the error thrown with these lines in the config is real and reproducible.

@berendt
berendt merged commit e7dc4a4 into main May 26, 2026
3 checks passed
@berendt
berendt deleted the fix-cloud-init-network-schema-warning branch May 26, 2026 14:26
@github-project-automation github-project-automation Bot moved this from In review to Done in Human Board May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants