The current ansible-playbook output parsing code,
|
m = re.fullmatch(r'([\w]+): \[.+\](: [^ ]+)?( =>)? (.+)', line, flags=re.DOTALL) |
, doesn't seem to catch complex errors.
For example this:
TASK [Ensure Active Authselect Profile Includes PAM Modules - Informative message based on the authselect integrity check result] ***
fatal: [192.168.123.157]: FAILED! => {
"assertion": "ansible_check_mode or result_authselect_check_cmd.rc == 0",
"changed": false,
"evaluated_to": false,
"msg": [
"authselect integrity check failed. Remediation aborted!",
"This remediation could not be applied because an authselect profile was not selected or the selected profile is not intact.",
"It is not recommended to manually edit the PAM files when authselect tool is available.",
"In cases where the default authselect profile does not cover a specific demand, a custom authselect profile is recommended."
]
}
causes the { to become the full error message,
2026-01-09 11:15:15 test.py:49: lib.results.report_plain:184: ERROR playbook: Ensure Active Authselect Profile Includes PAM Modules - Informative message based on the authselect integrity check result ({)
(see the last 3 characters)
I don't necessarily think we should parse every possible Ansible error output, but seeing just { makes it appear like a Contest bug, so maybe the note should be empty, or mention something like "complex error found, see ansible-playbook.log".
The current
ansible-playbookoutput parsing code,contest/lib/ansible.py
Line 81 in 596f5f4
For example this:
causes the
{to become the full error message,(see the last 3 characters)
I don't necessarily think we should parse every possible Ansible error output, but seeing just
{makes it appear like a Contest bug, so maybe the note should be empty, or mention something like "complex error found, see ansible-playbook.log".