Cloudinit with Rocky 9 via foreman

Problem:
Hi, recently I was successfully use the cloudinit the deploy with Centos 9
(Cloud-init Issue with VMware)
And this time I am planning to work with Rocky9. However, I am not sure why the VM cannot get the cloud-init template and applies it itself.
Basically 99.5% same ks.cfg for Roky9 and create the operating system in foreman and apply the same Provisioning templates to my host. But it could not get the config.

I checked the /var/lib/cloud/instances/ → it gives me the iid-datasource-none and all the files in the directory are blank.

Is there anything I needed to updated in Foreman so that it applies on my Rocky9?

I already tried disabling the firewalld in my ks.cfg

Expected outcome:
It works as charm with CentOS 9

Foreman and Proxy versions:
Foreman 3.10, Katello 4.12

this is my setup for datasource file
datasource_list: [NoCloud]
datasource:
NoCloud:
seedfrom: http://foremanvan01.corp.abc.ca/userdata/

network file
network:
config: disabled

I checked in the cloudinit template for the host, it gets what it wants and should be used to apply on the host

what I noticed is I have to login to the VM with the local account and then run cloud-init clean --reboot to get all the cloudinit template from foreman. It is not automated at all. I am not sure why the config is not applied at the first time’

this is my /etc/cloud/cloud.cfg
cloud_init_modules:

  • bootcmd
  • ssh

cloud_config_modules:

  • runcmd

cloud_final_modules:

  • scripts-per-once
  • scripts-per-boot
  • scripts-per-instance
  • scripts-user
  • phone-home

system_info:
distro: rocky
paths:
cloud_dir: /var/lib/cloud
templates_dir: /etc/cloud/templates
ssh_svcname: sshd

hey again :wink:

there was a bug in cloud init for el9 in the past, something about noCloud Datasource
Is the Rocky9 Image Up2Date?

What cloud-init Version is installed?

I’m only deploying Almalinux9, but should be the same, except if Rocky haven’t patched cloud-init like Almalinux

found the Errata

https://access.redhat.com/errata/RHBA-2024:3824

i had the same problem as you in the past

working version was cloud-init-23.1.1-12.el9 back in the days

Hi Dodo!

Rocky9 cloud-init package version:
cloud-init-23.4-7.el9_4.5.0.1.noarch

I found a work-around solution with the based image.
basically trigger it reboot if needed with a script during the image build process.

But do you get it work with Alma Linux 9 now? Anything you work with the Errata?

yes it’s working fine with almalinux9
i’ve got 23.4-7.el9_4.3.alma.1.noarch installed in Template

have not updated Template since then, but current version is 23.4-7.el9_4.6.alma.1

how’s your config looks like?

I used the exact config as Centos 9