Choosing which smart proxy will execute Ansible

I have an installation of Foreman, and another host as smart proxy with the Ansible plugin installed. All is integrated and the smart proxy was added to Foreman, with the Ansible and Dynflow plugins working.

My goal is to have this smart proxy executing every Ansible jobs and not the main Foreman host.

I don’t understand the dynamics or workflow on how this should work. Or the workflow for what I’m trying to do.

For example, if I add an Ansible role in the smart proxy, I’d be able to run it against a host managed by my main Foreman installation? I understand that I need to have Remote Execution plugin installed in Foreman, do I have to have it installed in the smart proxy as well?

I tried to add a role to a host, but when I tried to execute, an error message said it couldn’t find the role in the main Foreman. Do I have to have the role installed in both Foreman and the Smart proxy?

As you see, I’m a bit confused. Any help would be appreciated.

Hi,

First and foremost, could you share the version of the foreman and smart-proxy used, as well as the version of ansible plugins?

To try and help you out regardless of this information:
Each host is part of a subnet, each subnet in turn has a configuration tab for setting which “remote execution proxy” to use:

By default, if the host is unreachable via tha “remote execution proxy”, it will look for a different remote execution proxy to use, within the location and organization of that host. You can change this behaviour in the global settings:

In your case, you could try and disable “Global Proxy” and see if you get a better error message. (Could be that either your dynflow service isn’t running or isn’t correctly configured, …)

Concerning the installation, it’s enough to install ansible_proxy on the smart-proxy, it should have all the needed dependencies installed automatically (among which the remote execution plugin for smart-proxy).
A role is only needed on the actual proxy performing the playbook; so it’s not mandatory to install the roles on each ansible enabled smart-proxy.

BTW: It’s always useful to look into the logs for a smart-proxy as well to help identify some issues like this.

1 Like

Amazing answer. I’m working on the 1.20v.

Sorry for the lack of information. I was having a hard time understanding the concepts of working with smart proxies and Ansible and you nailed it, it’s a lot clearer now. This is exactly what I needed to know in order to accomplish this task.

I will put it to work and reply here with the results.

Thanks!

1 Like