Foreman_ansible_inventory

Problem:
I created an Ansible Role to create a Ceph Cluster
By the CLI I use the inventory loads and it runs without any problem
I started to setup the /etc/ansible/foreman.ini configuration, but I need details to complete this setup.
In the /etc/ansible/host I have the header [foreman_hostgroup_ceph-cluster] and the host members
In Foreman-UI I created a hostgroup ceph-cluster with the Ansible Role assigned.
The ceph hosts members are assign to the hostgroup ceph-cluster.
I created the Ansible Variables for the Ansible roles that have the host names listed.
When I execute a JOB with all the Ceph cluster members the Ansible Role runs independent for every single member and the installation does not succeed even with no errors found.

Expected outcome:
I’m looking to use Ansible inventory to load all hosts as I used by the CLI.
I am creating clusters that require to load all the nodes at the same time to be configure.

Foreman and Proxy versions:
1.22.0

Foreman and Proxy plugin versions:
defaults

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)

logs

Hi,
I’ve got exactly the same problem, I opened an issue a few months ago but without luck for the moment.

Foreman Support.

What is your plan to resolve this host inventory problem?

Thanks@

Switching to ansible runner should help. If you’re running recent versions, make sure you have ansible-runner installed on proxy and change the implementation in Settings -> Ansible. Runner should run everything altogether (there’s limit of 1000 per batch IIRC)

Do you have the URL that explain how to enable/configure Ansible runner?

Hello, the process in general is

  1. on all foreman proxy servers where Ansible feature is enabled, install ansible-runner package, available at https://releases.ansible.com/ansible-runner/

  2. In Foreman UI, navigate to Administer -> Settings -> Ansible -> Implementation for running Ansible and change the value to ansible-runner

From now on, Foreman will use ansible-runner instead of spawning ansible-playbook command separately for each host. The run is performed in batches of 100 hosts. Note that it’s impossible to cancel the run on per host basis any longer. Also jobs in a single batch will be marked as done only after the run of all hosts in batch finishes. All other functionality remains the same, e.g. user can still observe the partial progress per host.

Hi, Marek.
Is ansible-runner set by default now?
Because i dont see that option in UI. Foreman-2.3.3-1, katello-3.18.1-1, foreman_ansible-6.1.1-1, ansible-runner-1.4.7-1

Hello

yes, the ansible-runner is now the only way we run ansible from Foreman. I think it was the default for some time and then we kept it as the only option. Do you have any feedback about this implementation?

Hello.
I have no feedback at the moment, just preparing my foreman to run roles on large amount of hosts on daily basis.
Last time(1 - 1.5 years ago) i tried to run roles on 200+ hosts ended up with failure and oom crashes.
So i’m just trying to get things in order

Let us know your findings please