How to integrate Foreman with remote Ansible server

Before I spend hours trying to do something that can't be done, I thought I'd ask for help and clarification.

The scenario is that I have Foreman and Ansible on separate servers. What I want to have happen is that after an unintended Foreman install, the Ansible server is asked to invoke a role/playbook on the newly provisioned node.

Although I have seen some documentation regarding running an Ansible role as part of the provision process, the requirements, process and limitations are pretty sparse.

If it can be done at all, I'm guessing something like the following:

   - Installation of Foreman-Proxy on the Ansible host.
   - Download of roles to Foreman using Forman-proxy and/or Ansible    plugin. Not at all clear here if the proxy is required or if the Ansible    plugin is involved at this point.
   - Assignment of the role as part of the provisioning process.

Would someone help me out and let me know if it can be done, and the necessary steps?

Thx in advance,

-steve
I hope someone corrects me if I'm wrong. You need foreman proxy with proxy ansible plugin on your ansible host. Then add the proxy to Foreman and import roles from it. For this and triggering the ansible run, you need ansible plugin on Foreman side. Note that importing does not download roles, it only import their names.

Once you have roles imported, you can assign them to host/hostgroup. You can assign them also when you create new host, therefore set them before provisioning starts. I *think* there's a setting to perform initial ansible run at the end of provisioning process, if not it should happen automatically.

··· --
Marek

On December 1, 2017 18:52:24 Stephen Nesbitt <nesbittmeister@gmail.com> wrote:

Before I spend hours trying to do something that can't be done, I thought
I'd ask for help and clarification.

The scenario is that I have Foreman and Ansible on separate servers. What I
want to have happen is that after an unintended Foreman install, the
Ansible server is asked to invoke a role/playbook on the newly provisioned
node.

Although I have seen some documentation regarding running an Ansible role
as part of the provision process, the requirements, process and limitations
are pretty sparse.

If it can be done at all, I'm guessing something like the following:

- Installation of Foreman-Proxy on the Ansible host.
- Download of roles to Foreman using Forman-proxy and/or Ansible
plugin. Not at all clear here if the proxy is required or if the Ansible
plugin is involved at this point.
- Assignment of the role as part of the provisioning process.

Would someone help me out and let me know if it can be done, and the
necessary steps?

Thx in advance,

-steve

--
You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.