Foreman Provisioning Adding remote execution user

Dear experts,

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?

What is the best way?

Thanks.

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.

Thanks @Dirk . Which snippet are you referring to as I can’t find it to adjust?

The snippet is remote_execution_ssh_keys. Typically no need to adjust as it will take parameter provided by the settings/host parameters.