Do I actually need the Ansible plugin?

Hi folk! I currently run Foreman and AWX side by side — AWX/Ansible use the foreman dynamic inventory plugin to retrieve inventory from our Foreman server (the single source of truth). Ansible runs via AWX also send reports back to Foreman. However, I do not use any of the remote execution functionality from the plugin. So my question is – do I need Foreman’s Ansible plugin?

I very vaguely recall coming across a PR that appeared to indicate that you can do the inventory + callback part without the plugin, but I don’t see anything definitive. =)


Hi @jadestorm,

Not at all. If you use AWX or Tower, remote execution is useless as it’s your awx/tower who will perform ssh connection (run playbook). The most important part to interact with awx/tower from foreman is the provisioning callback, to notify awx/tower. It’s not mandatory as you can manage your provisioning workflow directly from awx/tower (ask to foreman to build host, add host to inventory, then perform actions on it).

1 Like

Excellent, thank you! For some reason I was under the impression that the ansible plugin for Foreman was required for the inventory portion and/or reporting to work. (meaning the plugin is what massaged the inventory for consumption by ansible and massaged incoming reports) =) Definitely will be nice to simplify my Foreman setup.

From memory (last year), the Ansible plugin is not needed to interact with awx. I used (as needed) either the call back provisioning from the foreman templates, or I directly used awx to ask foreman to create a host, then added it to an inventory, then I applied playbooks (awx workflow) . If you use callback provisioning, you have to do some configuration on the awx side to define it and provide the key to the template. I hope I’m not mistaken, I’ve been on puppet again since this year :frowning:

Just for the record, there are some docs here: Configuring Foreman to use Ansible
I might remove them from this guide as they are a bit buried.

FWIW, if you want to use Foreman as the inventory for AWX using our inventory plugin I would suggest having the Ansible plugin for Foreman installed, as this allows you to use use_reports_api: True in the the inventory configuration, making the inventory fetching much faster.


Hrm well that’s exactly what I had read before so it sounds like it would be beneficial for me to keep it. =) At some level, I wish I could just have the ansible reports api stuff without the remote_execution components installed. But hey, we just ignore it for now. Thanks!

Hi, you could also give the application centric deployment (foreman_acd) plugin a try.
ACD gives you the possibility to manage and trigger ansible playbooks directly from foreman.