canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
2.99k stars 883 forks source link

Invalid cloud-config provided warning but still works -- how to remove? #3984

Open ubuntu-server-builder opened 1 year ago

ubuntu-server-builder commented 1 year ago

This bug was originally filed in Launchpad as LP: #1977818

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2022-06-07T09:09:43.404736+00:00
date_fix_committed = None
date_fix_released = None
id = 1977818
importance = medium
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1977818
milestone = None
owner = kimsia
owner_name = kimsia sim
private = False
status = triaged
submitter = kimsia
submitter_name = kimsia sim
tags = []
duplicates = []

Launchpad user kimsia sim(kimsia) wrote on 2022-06-07T09:09:43.404736+00:00

I get an invalid cloud-config warning despite everything working as expected.

This is the question i asked in superuser https://superuser.com/questions/1725127/invalid-config-for-cloud-init-but-apparently-still-works-how-do-i-remove-the

the cloud provider is DigitalOcean

this is not the full config

cloud-config

package_update: true package_upgrade: true users:

See attached for the logs

ubuntu-server-builder commented 1 year ago

Launchpad user kimsia sim(kimsia) wrote on 2022-06-07T09:09:43.404736+00:00

Launchpad attachments: cloud-init.tar.gz

ubuntu-server-builder commented 1 year ago

Launchpad user James Falcon(falcojr) wrote on 2022-06-07T13:58:24.344143+00:00

If you look at the docs (https://cloudinit.readthedocs.io/en/latest/topics/modules.html#users-and-groups), the key name is ssh_authorized_keys rather than ssh-authorized-keys. The latter is deprecated, though it looks like a deprecation warning was missed.

This should work with no warnings:

cloud-config

package_update: true package_upgrade: true users:

ubuntu-server-builder commented 1 year ago

Launchpad user kimsia sim(kimsia) wrote on 2022-06-07T16:37:52.005312+00:00

Thank you. I will try this out and come back to confirm later.