Attribute type returns: 

   "msg": "AnsibleUnsafeText"


- debug:
      msg: "{{ sql_delete }}"

returns:

ok: [ibmi01] => {
    "msg": {
        "changed": false,
        "delta": "0:00:00.325885",
        "end": "2021-03-14 23:05:33.098261",
        "failed": true,
        "msg": "non-zero return code:255",
        "rc": 255,
        "sql": "DELETE FROM ANSIBLIB.QCUSTCDT WHERE CDTLMT < 9999.00",
        "start": "2021-03-14 23:05:32.772376",
        *"stderr": "{'error': '*** error DELETE FROM ANSIBLIB.QCUSTCDT 
WHERE CDTLMT < 9999.00', 'version': 'XML Toolkit 1.9.2', 'xmlhint': 
'02000:100:Row not found for DELETE.', 'xmlhint1': '02000:100:Row not found 
for DELETE.', 'jobipc': '*na', 'jobipcskey': 'FFFFFFFF', 'jobname': 
'QSQSRVR', 'jobuser': 'QUSER', 'jobnbr': '007433', 'curuser': 'GROBINSO', 
'ccsid': '1146', 'dftccsid': '1146', 'paseccsid': '0', 'syslibl': 'QSYS 
QSYS2 QHLPSYS QUSRSYS', 'usrlibl': 'QGPL QTEMP'}",*
        "stderr_lines": [
            "{'error': '*** error DELETE FROM ANSIBLIB.QCUSTCDT WHERE 
CDTLMT < 9999.00', 'version': 'XML Toolkit 1.9.2', 'xmlhint': 
'02000:100:Row not found for DELETE.', 'xmlhint1': '02000:100:Row not found 
for DELETE.', 'jobipc': '*na', 'jobipcskey': 'FFFFFFFF', 'jobname': 
'QSQSRVR', 'jobuser': 'QUSER', 'jobnbr': '007433', 'curuser': 'GROBINSO', 
'ccsid': '1146', 'dftccsid': '1146', 'paseccsid': '0', 'syslibl': 'QSYS 
QSYS2 QHLPSYS QUSRSYS', 'usrlibl': 'QGPL QTEMP'}"
        ],
        "stdout": "",
        "stdout_lines": []
    }
}

On Monday, 15 March 2021 at 10:56:18 UTC [email protected] wrote:

> What type is the attribute *stderr*? Try
>
> - debug:
> msg: "{{ sql_delete.stderr|type_debug }}"
>
> If the type is string convert it to dictionary first, e.g
>
> - debug:
> msg: "{{ _stderr.xmlhint }}"
> vars:
> _stderr: "{{ sql_delete.stderr|from_yaml }}"
>
>
> -- 
> Vladimir Botka
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/421f5a93-c493-4060-876c-51fcf543472bn%40googlegroups.com.

Reply via email to