Foreman 1.24.1 - Ansible Roles not running after build of host

After what appears to be a successful build of a host, we have a series of Ansible roles that need to run. In past versions I was able to watch the progress under Monitor>Jobs> locate the host > click on host name down by status.

I’m expecting to see output when I view the black pane. It’s also unknown if the ansible roles are even running. I haven’t found the logs yet.

rpm -qa|grep foreman

tfm-rubygem-foreman_ansible_core-3.0.1-1.fm1_24.el7.noarch
tfm-rubygem-hammer_cli_foreman-0.19.5-1.el7.noarch
foreman-release-scl-7-2.el7.noarch
tfm-rubygem-foreman-tasks-core-0.3.3-1.fm1_24.el7.noarch
tfm-rubygem-foreman_ansible-4.0.3-1.fm1_24.el7.noarch
foreman-cli-1.24.1-1.el7.noarch
tfm-rubygem-foreman_remote_execution-2.0.6-1.fm1_24.el7.noarch
foreman-1.24.1-1.el7.noarch
foreman-installer-1.24.1-1.el7.noarch
tfm-rubygem-foreman_remote_execution_core-1.3.0-1.el7.noarch
tfm-rubygem-foreman_discovery-16.0.1-1.fm1_24.el7.noarch
foreman-debug-1.24.1-1.el7.noarch
foreman-selinux-1.24.1-1.el7.noarch
foreman-proxy-1.24.1-1.el7.noarch
rubygem-foreman_maintain-0.5.0-1.el7.noarch
tfm-rubygem-foreman-tasks-0.17.5-1.fm1_24.el7.noarch
foreman-postgresql-1.24.1-1.el7.noarch

Hi @jaysullivan,

We noticed a problem in 1.24 with ansible being stuck. The solutions boils down to updating the ansible-core plugin from 3.0.1 to 3.0.2 ;however, this package seems to be only available from the 1.25 repo. (check out yum.theforeman.org)
I’ve detailed this solution in the following post:
Katello/Foreman Ansible run jobs stuck in pending state

I hope this helps you out!

Kind regards,
Arend

If it will help,

Just addedForeman Nightly to my local foreman repo:

[foreman]
name=Foreman Nightly
baseurl=https://yum.theforeman.org/plugins/nightly/el7/$basearch
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-foreman

[foreman-source]
name=Foreman Nightly - source
baseurl=https://yum.theforeman.org/plugins/nightly/el7/x86_64/
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-foreman

and updated the ansible core from 3.0.1 to 3.0.2 as so:

yum upgrade tfm-rubygem-foreman_ansible_core

rpm -qa | grep ansible
tfm-rubygem-foreman_ansible_core-3.0.2-1.fm1_25.el7.noarch

Thanks .

Hi,

that seemed to have fixed at least getting the roles to run. However, now the problem is I had set a number of roles to run, and they aren’t all running

All those roles on the left, were once assigned to this host group. They are now not there and are not running. Any ideas how to fix this?

I think we saw this once before, however I don’t remember when that was.

-Jay

If I click all the +, and click submit, nothing changes. The roles don’t update.

-Jay

Hi,

I’m new to Formean and have, based on this solution, upgraded foreman from 1.24.1 to 1.24.2.
However when i run an ansible role for a host, it still remains in pending state.
When viewing the running task details, it still gets stuck at 25%.
So I’m forced to abort the job.

Meanwhile, following is constantly written in the logging:

2020-02-24T12:04:06 [I|app|1247901f] Completed 200 OK in 67ms (Views: 30.7ms | ActiveRecord: 8.6ms)
2020-02-24T12:04:07 [I|app|15111d46] Started GET “/job_invocations/chart?id=16” for 10.16.8.1 at 2020-02-24 12:04:07 +0100
2020-02-24T12:04:07 [I|app|15111d46] Processing by JobInvocationsController#chart as JSON
2020-02-24T12:04:07 [I|app|15111d46] Parameters: {“id”=>“16”}
2020-02-24T12:04:07 [I|app|15111d46] Completed 200 OK in 67ms (Views: 0.3ms | ActiveRecord: 6.4ms)
2020-02-24T12:04:07 [I|app|8a6fe849] Started GET “/job_invocations/16?hosts_needs_refresh=&host_ids_needing_status_update%5B%5D=6&=1582542222853" for 10.16.8.1 at 2020-02-24 12:04:07 +0100
2020-02-24T12:04:07 [I|app|8a6fe849] Processing by JobInvocationsController#show as JS
2020-02-24T12:04:07 [I|app|8a6fe849] Parameters: {“hosts_needs_refresh”=>"", “host_ids_needing_status_update”=>[“6”], "
”=>“1582542222853”, “id”=>“16”}
2020-02-24T12:04:07 [I|app|8a6fe849] Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-2.0.8/app/views/job_invocations/show.js.erb
2020-02-24T12:04:07 [I|app|8a6fe849] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-2.0.8/app/views/job_invocations/_host_status_td.html.erb (0.5ms)
2020-02-24T12:04:07 [I|app|8a6fe849] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-2.0.8/app/views/job_invocations/show.js.erb (36.7ms)

I’m also confused about the IP mentioned in the log.
It is the gateway for one of the interfaces I have added to my host, so why is it using this IP!

I hope someone can help me figuring out what might be wrong.