can’t help you with that
could be some bug in the cloud-init Version in CentOS Stream8
i would advise against of using cloud-init in foreman like you do
just setup a simple VM template with all steps from the docs
i’ve set up a really small cloud-init userdata template in katello like here
every other bit of configuration is doing Ansible, never had any problems with that
cloud-init just got so many issue for me, i don’t know if it’s because of the NoCloud Datasource, or if cloud-init just acts really strange sometimes
troubleshooting cloud-init issues is also not fun