Ansible facts are not updated after job execution
Environment
- Red Hat Satellite 6.13.3 and newer
Issue
- Ansible facts for host are not getting updated after Ansible job execution.
Resolution
Update your existing Job Template or in case you are using default make a clone and enable ansible callback
-
To update job template
WebUI -> Hosts -> Job Templates -> select used template -> in Tab Ansible enable Enable Ansible Callback and submit.
-
To make Clone of used Job Template
WebUI -> Hosts -> Job Templates -> select used template -> Clone -> in Tab Ansible enable Enable Ansible Callback and submit.
In case you need the facts updated at next Job execution or Recurring job planning select profile with Ansible Callback enabled.
For more KB articles/solutions related to Red Hat Satellite 6.x Remote Execution Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Remote Execution Issues
Root Cause
In Satellite 6.13.3 was presented new feature for Ansible job templates Enable Ansible Callback which is by default disabled. Because of this when job is executed and using default job templates facts are not send back to Satellite.
Diagnostic Steps
-
Verify if used Job Template of type Ansible have Enable Ansible Callback enabled or disabled
WebUI -> Hosts -> Job Templates -> select use template -> Tab Ansible
-
Check in log if facts are sent and processed after job execution:
# grep -e "/foreman_tasks/api/tasks/callback" -e "Import facts" /var/log/foreman/production.log 2024-01-01T04:29:43 [I|app|c74e722e] Import facts for 'host.example.com' completed. Added: 0, Updated: 2, Deleted 0 facts 2024-01-01T11:23:43 [I|app|69617fdf] Import facts for 'host.example.com' completed. Added: 0, Updated: 50, Deleted 0 facts 2024-01-01T11:23:46 [I|app|f0a58578] Started POST "/foreman_tasks/api/tasks/callback" for 192.168.1.2 at 2024-01-01 11:23:46 +0100 <<<< Job execution 2024-01-01T11:25:45 [I|app|3e885357] Import facts for 'host.example.com' completed. Added: 0, Updated: 24, Deleted 0 facts <<<< Fact import 2024-01-01T11:25:53 [I|app|e428052a] Started POST "/foreman_tasks/api/tasks/callback" for 192.168.1.2 at 2024-01-01 11:25:53 +0100 2024-01-01T12:29:43 [I|app|4c097dec] Import facts for 'host.example.com' completed. Added: 7, Updated: 2, Deleted 0 facts 2024-01-01T15:17:18 [I|app|9ae8986a] Started POST "/foreman_tasks/api/tasks/callback" for 192.168.1.2 at 2024-01-01 15:17:18 +0100 <<<< Job execution, no fact import 2024-01-01T17:54:54 [I|app|35e954cb] Started POST "/foreman_tasks/api/tasks/callback" for 192.168.1.2 at 2024-01-01 17:54:54 +0100 2024-01-01T17:57:30 [I|app|0f12a5dc] Started POST "/foreman_tasks/api/tasks/callback" for 192.168.1.2 at 2024-01-01 17:57:30 +0100 2024-01-01T18:02:53 [I|app|778a7615] Import facts for 'host.example.com' completed. Added: 3, Updated: 23, Deleted 4 facts 2024-01-01T18:03:01 [I|app|3cb9a586] Started POST "/foreman_tasks/api/tasks/callback" for 192.168.1.2 at 2024-01-01 18:03:01 +0100 2024-01-01T16:14:00 [I|app|22ffaed0] Import facts for 'host.example.com' completed. Added: 0, Updated: 14, Deleted 0 facts 2024-01-01T16:14:07 [I|app|79c5bde5] Started POST "/foreman_tasks/api/tasks/callback" for 192.168.1.2 at 2024-01-01 16:14:07 +0100 2024-01-01T16:20:03 [I|app|5e3d5036] Import facts for 'host.example.com' completed. Added: 0, Updated: 19, Deleted 0 facts 2024-01-01T16:20:10 [I|app|dd541646] Started POST "/foreman_tasks/api/tasks/callback" for 192.168.1.2 at 2024-01-01 16:20:10 +0100 2024-01-01T16:21:43 [I|app|3ea46603] Started POST "/foreman_tasks/api/tasks/callback" for 192.168.1.2 at 2024-01-01 16:21:43 +0100 2024-01-01T16:22:08 [I|app|8d8bf53c] Import facts for 'host.example.com' completed. Added: 0, Updated: 19, Deleted 0 facts 2024-01-01T16:22:16 [I|app|97832a26] Started POST "/foreman_tasks/api/tasks/callback" for 192.168.1.2 at 2024-01-01 16:22:16 +0100
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.