Ansible for IBM Z - Group home

Fall is for planning, what are you planning to automate?

  

The autumnal equinox is considered the first day of fall, it's one of two moments a year when the sun is above the equator, day and night are roughly equal. For many, this is the time of year they begin their planning, what will you plan to automate? With the IBM z/OS Core version 1.11.0 release, Z Open Automation Utilities and IBM Open Enterprise SDK for Python bypassable requisites, you have a winning combination that can automate anything.

IBM z/OS Ansible Core version 1.11.0 has released to Ansible Automation Platform (AAP),  Galaxy and is available in GitHub. This release comes with optional service and support for AAP users and community support for Galaxy and GitHub users. While you are enjoying some seasonal warm beverages, I recommend reviewing the release notes and the changelog for the detailed changes.

This release has enhanced 16 modules with over 30 new features and delivered 5 bug fixes, documentation updates, new examples and sample playbooks.

What's really in the release? 

If you had not seen the blog Oscar Fernandes wrote outlining the beta release, then you are in for a treat. This release focuses primarily on supporting generation data groups (GDG), generation data sets (GDS) with relative name notation, special characters ($ # @) and hyphens in data sets, for example, PROD.DATA#OUT.USER$001

You can use Ansible to produce new automation, replace existing automation or augment existing automation. We prefer the better together approach where Ansible integrates with existing automation and is why this release includes support for GDG and GDS operations such as create, delete, copy, read, edit, archive, catalog and uncatalogued


How will I know which modules support GDG and which support special characters?

There are some modules that were not updated with GDG support only because no use case could be identified but did receive special character enhancements. 

While it is all documented, here is a table overview of which modules received the outlined updates. 


For modules zos_script, zos_job_submit and zos_unarchive, their performance and ability to run in an execution environment was improved by changing the plugins mechanics when interacting with peer modules. Previously, the plugins would perform a thorough mapping of objects through serialization accumulating more than is necessary which could lead to instability, a new architecture has been deployed that reduces these requirements without the need for serialization. 


Were any bugs fixed?

Absolutely, if there are bugs, the team ensures they address them, in this release several modules had been updated. 

  • zos_copy
    • Fixes an issue that prevented the module from automatically computing member names when copying a file into a PDS/E.
    • Fixes an issue that would perform an unnecessary check if a destination data set were locked for data sets the module created.
  • zos_data_set
    • Fixes an issue that when checking if a data set is cataloged, did not account for all exceptions. 
  • zos_job_submit
    • Fixes an issue that under certain Unicode decoding, the error type was generically described. 
  • zos_mvs_raw
    • Fixes an issue where the first character of each line in dd_output was missing.

Why use Ansible with a GDG?

z/OS supports various types of data sets that align to different storage requirements.

  • Sequential data sets offer linear access.
  • Partitioned data sets allow for logical grouping of members for related content.
  • VSAM data sets provide direct access through indexing.
  • GDGs allow for easy version control and data retention

Generation data group are a collection of related non-VSAM data sets arranged in a chronological numerical ordering referred to as their age. Older data sets have smaller negative numbers (-3, -2, -1), the latest is zero, and a new generation is a positive number. For example, ROLLING.LOG(0) is the most recent data set of the group, ROLLING.LOG(-1) is the second most recent and a positive number ROLLING.LOG(+1) represents a new generation. 

If you want to access data from a GDG, do not use wildcard characters to represent generations, instead specify the GDG base name.  


Some of the GDG advantages are:

  • The z/OS operating system keeps the generations in chronological order. 
  • Automatic deletion for older outdated GDGs by the z/OS operating system. 
  • All the data sets in the GDG can be referred to by the base name.

Imagine you are using a GDG to source control some JCL and wanted to submit the different versions to compare results. You could use the IBM z/OS Core module zos_job_submit to submit the various generations.


For example:  
- name: Submit JCL from the latest generation data set in a generation data group.
  zos_job_submit:
    src: PROD.SRC.APP(0)
    location: data_set

- name: Submit JCL from a previous generation data set in a generation data group.
  zos_job_submit:
    src: PROD.SRC.APP(-2)
    location: data_set

Or maybe you are using a GDG to manage rolling logs and are nearing the maximum number of GDGs permitted and you would like to move the data into storage. You could use the IBM z/OS core collections zos_copy or zos_fetch to transfer the data and then with zos_archive compress the data.

 
- name: Copy the rolling log from a GDG to GDG storage.
  zos_copy:
    src: ROLLING.LOG(-199)
    dest: STORAGE.ROLLING.LOG(+1)
    remote_src: true

- name: Archive multiple GDSs into a terse
  zos_archive:
    src:
      - "STORAGE.ROLLING.LOG(0)"
      - "STORAGE.ROLLING.LOG(-1)"
      - "STORAGE.ROLLING.LOG(-2)"
    dest: "STORAGE.ROLLING.LOG.TRS"
    format:
      name: terse
      format_options:
        use_adrdssu: True

If you enjoy trying out the latest, stay tuned for our next beta releasing in early Q4 2024, version 1.12.0-beta.1. Until then, we hope to hear about your fall automation plans. 

Where can I ask a question?

If you would like to reach out to us because you have question, want to report an issue or make a feature request, below are the various communication channels we monitor. 

About the Author

Demetrios Dimatos is the IBM z/OS Ansible Core Senior Technical Lead with 17 years mainframe experience and over 20 years of development experience; having led multiple products ranging from client server technologies, administration consoles, IBM Open Platform (Hadoop - HDFS, MapReduce, Yarn) and Spark, Linux, and Solaris kernel development. 

The Development Team

Without the development team, this would not be possible. I would like to thank the amazing team who work with passion and perseverance on this project. 

  • Rich Parker
  • Ketan Kelkar
  • Oscar Fernando Flores Garcia
  • Ivan Alejandro Moreno Soto
  • Andre Marcel Gutierrez Benitez

Resources

IBM Ansible z/OS core on Galaxy
IBM Ansible Core Collection Repository on GitHub
IBM Ansible Core Collection on Automation Hub
Red Hat® Ansible Certified Content for IBM Z documentation