Bug 1931489
| Summary: | Timeout to kill settings in job execution is not honored when running an Ansible playbook | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Teoman ONAY <tonay> |
| Component: | Ansible - Configuration Management | Assignee: | satellite6-bugs <satellite6-bugs> |
| Status: | CLOSED ERRATA | QA Contact: | Sam Bible <sbible> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.8.0 | CC: | aruzicka, lstejska, oezr, pcreech, zhunting |
| Target Milestone: | 6.11.0 | Keywords: | Triaged |
| Target Release: | Unused | ||
| Hardware: | x86_64 | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | tfm-rubygem-smart_proxy_ansible-3.3.0, | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-07-05 14:28:45 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Could you attach output from that job to this bz? Is this what you need?
Job 204 - Ansible playbook with a timeout of 30 sec
Job 203 - remote command with a timeout of 30 sec
[root@satellite ~]# hammer job-invocation info --id=204
ID: 204
Description: Ansible - Run playbook with inputs playbook="---
- hosts: all
tasks:
- name: Pause for 2 minutes
pause:
minutes: 2
"
Status: succeeded
Success: 1
Failed: 0
Pending: 0
Total: 1
Start: 2021-02-22 13:59:45 UTC
Randomized ordering: false
Job Category: Ansible Playbook
Hosts:
- oscar-ducote.lab-internal.localdomain
[root@satellite ~]# hammer job-invocation info --id=203
ID: 203
Description: Run /root/wait.sh
Status: failed
Success: 0
Failed: 1
Pending: 0
Total: 1
Start: 2021-02-22 13:03:45 UTC
Randomized ordering: false
Job Category: Commands
Hosts:
- oscar-ducote.lab-internal.localdomain
[root@satellite ~]# hammer job-invocation output --host "oscar-ducote.lab-internal.localdomain" --id=204
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [tonay-oscar-ducote.lab-internal.localdomain]
TASK [Pause for 2 minutes] **********************************
Pausing for 120 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
ok: [oscar-ducote.lab-internal.localdomain]
PLAY RECAP *********************************************************************
tonay-oscar-ducote.lab-internal.localdomain : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Exit status: 0
[root@satellite ~]# hammer job-invocation output --host "oscar-ducote.lab-internal.localdomain" --id=203
Timeout for execution passed, trying to stop the job
Exit status: TERM
Created redmine issue https://projects.theforeman.org/issues/32203 from this bug Upstream bug assigned to ymakias Upstream bug assigned to ymakias Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32203 has been resolved. Verified on 6.11 - 16
Steps to verify:
1) Create a Job Template that runs this Ansible Playbook:
---
- hosts: all
tasks:
- name: Pause for 2 minutes
pause:
minutes: 2
2)Set timeout for the Job to 30 seconds.
3)Execute job on Host
Expected Results:
Job is terminated after 30 seconds, respecting the timeout settings
Actual Results:
Job is terminated after 30 seconds, respecting the timeout settings
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:5498 |
Description of problem: When executing an Ansible playbook via Satellite job scheduler, the "Timeout to kill" setting is not honored. I did a test using the "pause" module to make playbook last for 5 min: --- - hosts: all tasks: - name: Pause for 5 minutes pause: minutes: 5 and by setting the "timeout to kill" to 30 seconds, it should have terminated the job after 30 sec but it ran for the planned 5 min. Doing the same with a remote command (to execute a shell script hosted on the target) is killed as expected 1: Timeout for execution passed, trying to stop the job 2: Exit status: TERM Version-Release number of selected component (if applicable): 6.8.3 (6.6 as well) How reproducible: Create a playbook which last quite some time and set a "Timeout to kill" shorter Steps to Reproduce: 1. 2. 3. Actual results: - Ansible playbook continues to run after the "Timeout to kill" period. Expected results: - Ansible playbook should be killed after the "Timeout to kill" period. Additional info: