ibmi_sysval – Displays the specified system value
Synopsis
The
ibmi_sysvalmodule displays the information of the specified system value.Type of requisite values meaning refer to https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_74/apis/qwcrsval.htm
If the returned system valus is a list, set
checktoequal_as_listto compare it with theexpectvalue.
Parameters
- become_user
The name of the user profile that the IBM i task will run under.
Use this option to set a user with desired privileges to run the task.
required: falsetype: str- become_user_password
Use this option to set the password of the user specified in
become_user.required: falsetype: str- joblog
If set to
true, output the available job log even the rc is 0(success).required: falsetype: bool- sysvalue
Specifies the input system values. The detail explanations of the elements in the dict are as follows
nameis the name of the system value. (required)expectis the expected returned value. If it is a number, the system value will be converted to a number brfore comparison. (optional)checkis the comparison method, includingequal,rangeandequal_as_list. The default value isequal. (optional)required: Truetype: listelements: dict
Examples
- name: Get System Value information
ibm.power_ibmi.ibmi_sysval:
sysvalue:
- {'name':'qmaxsgnacn', 'expect':3}
- {'name':'qmaxsgnacn', 'expect':'000003'}
- {'name':'qccsid'}
become_user: 'USER1'
become_user_password: 'yourpassword'
- name: Compare the returned system values as list
ibm.power_ibmi.ibmi_sysval:
sysvalue:
- {'name':'QATNPGM', 'expect':'QEZMAIN QSYS'}
- {'name':'QATNPGM', 'expect':'QSYS QEZMAIN'}
- {'name':'QATNPGM', 'expect':'QEZMAIN QSYS', 'check':'equal_as_list'}
- {'name':'QATNPGM', 'expect':'QSYS QEZMAIN', 'check':'equal_as_list'}
- name: Check if the returned system values are in a range
ibm.power_ibmi.ibmi_sysval:
sysvalue:
- {'name':'qmaxsgnacn', 'expect':'[1,8)', 'check':'range'}
- {'name':'qccsid', 'expect':'[0,65535]', 'check':'range'}
Return Values
- rc
The command return code (0 means success, non-zero means failure).returned: alwaystype: intsample: 255- message
The command execution result.returned: when rc is not 0type: strsample: CPF2111:Library TESTLIB already exists- job_log
The IBM i job log of the task executed.returned: alwaystype: listsample:[{"FROM_INSTRUCTION": "318F", "FROM_LIBRARY": "QSYS", "FROM_MODULE": "", "FROM_PROCEDURE": "", "FROM_PROGRAM": "QWTCHGJB", "FROM_USER": "CHANGLE", "MESSAGE_FILE": "QCPFMSG", "MESSAGE_ID": "CPD0912", "MESSAGE_LIBRARY": "QSYS", "MESSAGE_SECOND_LEVEL_TEXT": "Cause . . . . . : This message is used by application programs as a general escape message.", "MESSAGE_SUBTYPE": "", "MESSAGE_TEXT": "Printer device PRT01 not found.", "MESSAGE_TIMESTAMP": "2020-05-20-21.41.40.845897", "MESSAGE_TYPE": "DIAGNOSTIC", "ORDINAL_POSITION": "5", "SEVERITY": "20", "TO_INSTRUCTION": "9369", "TO_LIBRARY": "QSYS", "TO_MODULE": "QSQSRVR", "TO_PROCEDURE": "QSQSRVR", "TO_PROGRAM": "QSQSRVR"}]- sysval
the system value informationreturned: alwaystype: listsample:[{"compliant": true, "expect": "3", "name": "QMAXSGNACN", "type": "4A", "value": "3"}, {"compliant": true, "name": "QCCSID", "type": "10i0", "value": "65535"}]- fail_list
the failed parametersreturned: when there are failed parameterstype: listsample:[{"compliant": false, "expect": "3", "name": "QMAXSGNACN", "type": "4A", "value": "1"}]