Ansible for IBM Z

Ansible for IBM Z

Ansible for IBM Z

Facilitate communication, user interaction and feedback for Red Hat Ansible Certified Content for IBM Z

 View Only

Now available IBM Ansible Core for Z v1.14.0-beta.1!

By Oscar Fernando Flores Garcia posted Wed April 30, 2025 07:51 PM

  

Hi all! Today I'm thrilled to announce the new IBM Ansible Core version 1.14.0-beta.1 release!!

This new beta release comes packed with a new module, 18 enhancements and 10 bugfixes. Some enhancements are removing the need to allow READ access to MVS.MCSOPER.ZOAU in zos_copy, return job execution time in zos_job_submit, zos_job_query and zos_job_output; and some bug fixes include zos_data_set fixes to trying to delete a non-existent Generation Data Group and getting TypeError when trying to replace an existing GDG. Also zos_job_submit, zos_job_query and zos_job_output performance improvement that when searching for a job name, the module would previously do a wildcard search and then filter, the module now searches specifically for that job name, improving performance. 

Enhancements

 
- zos_copy:
 
   - Adds large as a choice for type in dest_data_set.
   - Adds logging of Jinja rendered template content when use_template true and verbosity level -vvv is used.
   - Adds support for copying in asynchronous mode inside playbooks.
   - Removes the need to allow READ access to MVS.MCSOPER.ZOAU to execute the module by changing how the module checks if a data set is locked.
 
- zos_job_output: Add execution_time return value in the modules response.
- zos_job_query:
 
   - Add execution_time return value in the modules response.
   - Loads correct bytes size value for dds when using zoau 1.3.4 or later
   - System and Subsystem are now retrieved from JES.
 
- zos_job_submit:
 
   - Adds logging of Jinja rendered template content when `use_template` is true and verbosity level `-vvv` is used.
   - Add execution_time return value in the modules response.
   - Loads correct bytes size value for dds when using zoau 1.3.4 or later.
 
- zos_script:
 
   - Adds error message for when remote source does not exist.
   - Adds logging of Jinja rendered template content when `use_template` is true and verbosity level `-vvv` is used.
   - Adds support for running local and remote scripts in asynchronous mode inside playbooks.
   - Support automatic removal of carriage return line breaks [CR, CRLF] when copying local files to USS.
 
- zos_stat: Adds support to query data sets using their aliases.
- zos_unarchive: Adds support for unarchiving files in asynchronous mode inside playbooks.
- zos_zfs_resize: Adds validations for trace destination dataset used for trace verbose.
 

Bugfixes

 
- zos_apf: When trying to add a library into the APF list that was already added, the module would fail. Fix now will not fail the module, and will inform the user that the library is already on the APF list.
- zos_copy:
 
   - Previously, if the dataset name included special characters such as $, validation would fail when force_lock was false. This has been changed to allow the use of special characters when force_lock option is false.   
   - When asa_text was set to true at the same time as force_lock, a copy would fail saying the destination was already in use. Fix now opens destination data sets up with disposition SHR when force_lock and asa_text are set to true.
   - the carriage return characters were being removed from only first 1024 bytes of a file. Now fixed that issue to support removal of the carriage return characters from the complete file content if the file size is more than 1024 bytes.
 
- zos_data_set:
 
   - Module would fail when trying to delete a non-existent Generation Data Group. Fix now provides a successful response with changed=false.
   - Module would fail with TypeError when trying to replace an existing GDG. Fix now allows to replacing a GDG.
 
- zos_job_output: When searching for a job name, module performed a '*' (find all), then filtered the results. Fix now asks for specific job name, making the return faster and more precise.
- zos_job_query: When searching for a job name, module performed a '*' (find all), then filtered the results. Fix now asks for specific job name, making the return faster and more precise.
- zos_job_submit: When searching for a job name, module performed a '*' (find all), then filtered the results. Fix now asks for specific job name, making the return faster and more precise.
- zos_mount: Module failed when using persistent option with a data set that contains non UTF-8 characters. Fix now can use a data set with non UTF-8 characters as data_store.

New module: zos_stat

The new module zos_stat retrieves facts from resources stored in a z/OS System. What are some of these resources ? Unix System Services files, data sets, generation data groups and aggregates. To do this, simply use the following sample 

- name: Get the attributes of a sequential data set.
  zos_stat:
    name: USER.SEQ.DATA
    type: data_set

And from this, you can get the following output:

ok: [zvm] => {
    "msg": {
        "changed": true,
        "failed": false,
        "stat": {
            "attributes": {
                "active_gens": null,
                "allocation_available": 100,
                "allocation_used": 0,
                "atime": null,
                "audit_bits": null,
                "auditfid": null,
                "bitmap_file_size": null,
                "block_size": 27920,
                "blocks_per_track": 2,
                "charset": null,
                "checksum": null,
                "converttov5": null,
                "creation_date": "2025-04-30",
                "creation_time": null,
                "ctime": null,
                "data": {
                    "avg_record_length": null,
                    "bufspace": null,
                    "device_type": null,
                    "key_length": null,
                    "key_offset": null,
                    "max_record_length": null,
                    "spanned": null,
                    "total_records": null,
                    "volser": null
                },
                "dev": null,
                "device_type": "3390",
                "dir_blocks_allocated": null,
                "dir_blocks_used": null,
                "dsorg": "ps",
                "empty": null,
                "encrypted": false,
                "executable": null,
                "expiration_date": null,
                "extended": null,
                "extended_attrs_bits": null,
                "extents_allocated": 1,
                "extents_used": 0,
                "file_format": null,
                "filesystem_table_size": null,
                "free": null,
                "free_1k_fragments": null,
                "free_8k_blocks": null,
                "gid": null,
                "gr_name": null,
                "has_extended_attrs": false,
                "index": {
                    "avg_record_length": null,
                    "bufspace": null,
                    "device_type": null,
                    "key_length": null,
                    "key_offset": null,
                    "max_record_length": null,
                    "total_records": null,
                    "volser": null
                },
                "inode": null,
                "isblk": null,
                "ischr": null,
                "isdir": null,
                "isfifo": null,
                "isgid": null,
                "islnk": null,
                "isreg": null,
                "issock": null,
                "isuid": null,
                "jcl_attrs": {
                    "creation_job": null,
                    "creation_step": null
                },
                "key_label": null,
                "key_status": "none",
                "last_reference": null,
                "limit": null,
                "lnk_source": null,
                "lnk_target": null,
                "log_file_size": null,
                "max_pdse_generation": null,
                "members": null,
                "mimetype": null,
                "missing_volumes": [],
                "mode": null,
                "mtime": null,
                "nlink": null,
                "num_volumes": 1,
                "order": null,
                "pages_allocated": null,
                "pages_used": null,
                "pdse_version": null,
                "perc_pages_used": null,
                "primary_space": 100,
                "purge": null,
                "pw_name": null,
                "quiesced": {
                    "job": null,
                    "system": null,
                    "timestamp": null
                },
                "racf": "none",
                "readable": null,
                "record_format": "fb",
                "record_length": 80,
                "rgrp": null,
                "roth": null,
                "rusr": null,
                "scratch": null,
                "secondary_space": 10,
                "seq_type": "basic",
                "size": null,
                "sms_data_class": null,
                "sms_mgmt_class": null,
                "sms_storage_class": null,
                "space_units": "track",
                "sysplex_aware": null,
                "total_size": null,
                "tracks_per_cylinder": 15,
                "type": "seq",
                "uid": null,
                "updated_since_backup": false,
                "version": null,
                "volser": "222222",
                "volumes": [
                    "222222"
                ],
                "wgrp": null,
                "woth": null,
                "writeable": null,
                "wusr": null,
                "xgrp": null,
                "xoth": null,
                "xusr": null
            },
            "name": "OMVSADM.TEST.SEQA",
            "resource_type": "data_set"
        }
    }
}

As you can see from the output there are many attributes available to fetch from a data set, if the output is a USS file, aggregate or generation data group the output schema should not change, that should simplify your automation and you won't need to worry about changing return values.

We will deep dive in the enhancements, bugfixes and new module when the 1.14.0 GA release blog, so stay tuned for that. 

About the Author

Oscar Fernando Flores Garcia is the IBM z/OS Ansible Core Team Lead, with over 8 years of experience. Now leading the design and development of the ansible core product, responsible for many of the product releases.


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
  • Demetrios Dimatos
  • Surendra Ravella
  • Mayank Mani
  • Rohitash Goyal

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

0 comments
8 views

Permalink