IBM / ansible-for-i

the tool is to provide several customized modules for Ansible to manage IBM i systems.
GNU General Public License v3.0
54 stars 52 forks source link

ibmi_sysval should be able to change sysval values #162

Open syahrul-aiman opened 9 months ago

syahrul-aiman commented 9 months ago

Referring to: https://github.com/IBM/ansible-for-i/blob/devel/plugins/modules/ibmi_sysval.py

ibmi_sysval module should be able to change sysval values using the CHGSYSVAL command and not just perform checking. It should also follow the immutable concept where if the sysval already in the expected values, it would not be changed. Example yaml would be as follows:

- ibm.power_ibmi.ibmi_sysval:
    sysvalue:
      - name: QALWOBJRST
        expect: "*ALL *ALWPTF"
        check: "equal_as_list"
        value: "*ALL"

The above will check if QALWOBJRST is within the expected values and if not, will change the value as set in value if exists using the following command:

CHGSYSVAL SYSVAL({{ item.name }}) VALUE('{{ item.value }}')