Job Execution on Foreman hosts results in "No hosts found"

Problem:

We want to enable our users to create sandboxes independently. An Ansible template has been created for this purpose, which requires the Foreman host as the target host. As an administrator, I can execute the job without any problems, but as a normal user, the Foreman host is displayed as “Not found” in the result page and the job is not started.
If I use a different host for testing, the job is executed without any problems.
The default role “Remote Execution User” was used as the role for the user.

Expected outcome:

The job can be executed on the Foreman host.

Foreman and Proxy versions:

3.16.1 (Foreman and Proxy)

Foreman and Proxy plugin versions:

Foreman 3.16.1

Distribution and version:

Rocky Linux 9.6

Other relevant data:

A special permissions is needed to execute remote execution jobs against the foreman host itself. The resource for that is JobInvocation, the permission is execute_jobs_on_infrastructure_hosts. This permission is not in the default Remote Execution User role, as infrastructure host (Foreman itself and smart proxies) are considered special and access to them should be more restricted than to other, regular hosts. If you clone the default role, add this permission to it and use this custom role, you should be golden.

2 Likes

Thank you so much!