Problem:
Ansible has a quirk in that a successful run sometimes returns exit code 4 instead of 0. Foreman reports this as an error and sets “Last Execution Failed”. How can I fix this?
Of course I’ll also try to address this on the Ansible side, but I’m not sure if that is possible.
Below is an example for Ansible code that literally just calls “ping” but returns exit code 4 (for reasons I don’t understand. That’s outside Foreman’s scope of course).
Expected outcome:
Exit code 4 from an Ansible playbook should be treated like exit code 0.
Foreman and Proxy versions:
3.5.1
Foreman and Proxy plugin versions:
Distribution and version:
AlmaLinux 8.7
Other relevant data:
1:[DEPRECATION WARNING]: ANSIBLE_CALLBACK_WHITELIST option, normalizing names to
2:new standard, use ANSIBLE_CALLBACKS_ENABLED instead. This feature will be
3:removed from ansible-core in version 2.15. Deprecation warnings can be disabled
4: by setting deprecation_warnings=False in ansible.cfg.
5:[WARNING]: Callback disabled by environment. Disabling the Foreman callback
6:plugin.
7: ___________________________
8:| -W 60 -f default PLAY [all] |
9: ===========================
10: \
11: \
12: ^__^
13: (oo)\_______
14: (__)\ )\/\
15: ||----w |
16: || ||
17: ___________________________________
18:| -W 60 -f default TASK [Apply roles] |
19: ===================================
20: \
21: \
22: ^__^
23: (oo)\_______
24: (__)\ )\/\
25: ||----w |
26: || ||
27: __________________________________________
28:| -W 60 -f default TASK [usd-ping : Do ping] |
29: ==========================================
30: \
31: \
32: ^__^
33: (oo)\_______
34: (__)\ )\/\
35: ||----w |
36: || ||
37 ok: [<hostname>]
38:___________________________
39: <hostname> : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
40: Exit status: 4
41:StandardError: Job execution failed