Foreman Provisioning + AWX job template

Hi all,

Is that possible to setup Foreman to achieve the followings:
1). Provision a BareMetal through idrac from the foreman build process.
2). After the kickstart or just before finishing up the provisioning, Foreman will be able to run an AWX job template automatically to register that newly provisioned host to Foreman as an content host.

Thanks!

I’m not sure I’m following. Why would you trigger a job in awx to register the provisioned host into foreman rather than having the host register itself during provisioning?

I think the key here is the idrac ‘through idrac’ needs to be clarified, eg: launch through idrac but have the additional interface as the managed interface, or build/manage via idrac interface

I am just thinking of setting up foreman pxe-boot to the idrac network segment let say (192.168.100.X) to get the pxe boot going.

coz I have some ansible playbooks already developed so I would like to say after the kick_start finish it will run a awx job to finalize the customization of the host including foreman registration.
How do you achieve to register the newly host provisioned by foreman to become a foreman content host automatically during provisioning?

the kickstart does a call home to register itself to foreman, based on the ansible plugin and how you’ve configured it, it should run the ansible playbooks you’ve assigned to it post provision
The key bit for me is if you’re provisioning on the IDRAC network, are you going to register that address as the primary address for foreman, or do you mark a different interface as the management/primary interface and just use idrac as provisioning

Thanks @ikonia I am running into a bit of issue when Ansible role was invoke right after the provisioning. It seems that the ansible role that I have included to run (theforeman.foreman in my case) after the provisioning can’t connect to the server just after the provisioning. I am very confused at this point on which user that ansible role here is using to connect with the new host? Do I have to generate a ssh user/ key for that user somewhere in the foreman URL or in the kickstart default template?

what’s the connection error you get (as that may help refine where to look for the problem)