Extracting a value from stderr

11 views
Skip to first unread message

Glenn Robinson

unread,
Mar 14, 2021, 6:33:31 AM3/14/21
to Ansible Development
I'm using a module which returns some information in the module's register stderr variable when the module encounters an issue.

Using  - debug: var=sql_delete.stderr returns:

ok: [ibmi01] => {
    "sql_delete.stderr": {
        "ccsid": "1146",
        "curuser": "GROBINSO",
        "dftccsid": "1146",
        "error": "*** error DELETE FROM ANSIBLIB.QCUSTCDT WHERE CDTLMT < 9999.00",
        "jobipc": "*na",
        "jobipcskey": "FFFFFFFF",
        "jobname": "QSQSRVR",
        "jobnbr": "002988",
        "jobuser": "QUSER",
        "paseccsid": "0",
        "syslibl": "QSYS QSYS2 QHLPSYS QUSRSYS",
        "usrlibl": "QGPL QTEMP",
        "version": "XML Toolkit 1.9.2",
        "xmlhint": "02000:100:Row not found for DELETE.",
        "xmlhint1": "02000:100:Row not found for DELETE."
    }
}

I want to retrieve the value in the xmlhint item.

When i try and access that value by using:

sql_delete.stderr.xmlhint 

I get a variable not found error.

I've tried from_json, dict2items and dict2list but can't seem to reference the xmlhint, or any other key values, within stderr.

How do I reference the xmlhint value in sql_delete.stderr?


Reply all
Reply to author
Forward
0 new messages