I am having to run a bash script in Pre-Provisioning that registers the RHEL8 VM to Satellite. But if I choose the Install Agent checkbox on the image, it tries to run the cloud-init runcmd script before this registration has been performed, so the repos are not enabled, and the VM sits in a “Finalizing” state. Should I just run the /var/lib/cloud/instance/scripts/runcmd script after the satellite registration script? Or, is there a cleaner better way to install the agent as part of a provisioning workflow?
If you add the satellite registration script to the cloud-init user data on the virtual image record, it will run before the agent install runcmd as it will be added to the generated cloud-init userdata. pre-provision phase for vm’s does not execute before cloud-init run.