Modules

Modules can be used in a playbook to automate tasks. Ansible® executes each module on the target node and returns the result back to the controller.

The IBM® z/OS® CICS® collection provides modules for interacting with CMCI over an HTTP connection by leveraging the CMCI REST API, as well as modules to automate provisioning of a CICS TS region. These modules have different requirements of the managed node. For more detail see Requirements of managed nodes.

The region provisioning modules use two defaults groups that allow a user to specify the location of a CICS installation and a high level qualifier for all region data sets to be created under. The example below shows how to use these default groups within the cics_global_catalog module.

- name: Initialize a global catalog
  ibm.ibm_zos_cics.global_catalog:
    region_data_sets:
      template: "REGIONS.ABCD0001.<< data_set_name >>"
    cics_data_sets:
      template: "CICSTS61.CICS.<< lib_name >>"
    state: "initial"

In the above example, the global catalog will be created at the data set location REGIONS.ABCD0001.DFHGCD, and the CICS load libraries can be found at the location CICSTS61.CICS, which means that the SDFHLOAD library could be found at CICSTS61.CICS.SDFHLOAD.

These groups can be placed in a module_defaults section, which means that all the CICS provisioning modules will use the same high level qualifier for the region data sets, and the location of the CICS installation only has to be declared once for all the modules.

To override the data set location or name for a specific task, you can provide an additional parameter to the region_data_sets group as shown in the example for a global catalog data set below.

- name: Initialize a global catalog with a custom name
  ibm.ibm_zos_cics.global_catalog:
    region_data_sets:
      dfhgcd:
        dsn: "MY.CICS.GLOBAL.CATALOG"
    cics_data_sets:
      template: "CICSTS61.CICS.<< lib_name >>"
    state: "initial"

The IBM® z/OS® CICS® collection contains these modules. For each module, the accepted parameters, return values, and examples are provided in the documentation.