✓ Solved

cloud-init/config not working when creating new node

I have tried a couple of times but it seems the cloud-config stuff isn't working. I've tried to just update/upgrade packages to doing a little more. Although none of them seem to be working. I read through the linode pages about using cloud-config and I must have missed something. I pulled all of these from the examples at https://cloudinit.readthedocs.io/en/latest/index.html

*edit: I'm using the Cloud Manager UI and adding the below to the 'User Data' section.

ssh_pwauth: false
- name: ansible
  gecos: Ansible User
  groups: users,admin,wheel
  shell: /bin/bash
  lock_passwd: true
    - "ssh-ed25519 [---]"
hostname: my-cool-node
create_hostname_file: true
prefer_fqdn_over_hostname: false
preserve_hostname: true
package_update: true
package_upgrade: true

3 Replies

✓ Best Answer

Are you receiving any specific errors when this fails, or is the instance just being created without the specified parameters?

If it is the latter, have you run through the first steps listed here?

Regardless, just in case you did not see the below resources, I wanted to share them because they give a pretty detailed rundown as to how to utilize the Cloud-init functionality:

How to config & secure a compute instance:

How to add user data:

How to add metadata:

Links to several other guides that relate to cloud-init:

I hope that helps!


@mtcotton846 thank you for the reply. After reading your post, I created another nano ubuntu 22.04 with the following

package_update: true
package_upgrade: true
hostname: examplehost

The hostname was set and packages and been updated/upgraded. I didn't see any errors (also I wasn't seeing errors before). The default user "ubuntu" with default password "password" was not created. As per the verify that cloud init ran. Also, this time I did not connect a VPC or Firewall. So I'm going to do some more testing adding those items and trying to create a new user.


@mtcotton846 well it was me, I didn't pay attention to the groups key. It had the wrong groups.



Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct