I have enabled Ansible to run a foreman subscription role after the Foreman provisioning. However, I am getting an error that the post ansible role task through foreman remote execution will use root as effective user to connect from the foreman server to the newly provisioned host, which is impossible to ssh to the newly provisioned host using root.
Do I have to rewrite the kickstart finish default template to add a non root user, and ssh-copy-id the key over to the new provisioned host first?
The snippet which sets up remote execution user will use the user from the configuration (overwrite-able by a host parameter) and will set it up during deployment (including sudo), so just adjusting the settings should be enough.
For an already provisioned host just set up the user and copy the key over after adjusting the settings.