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

IBM z/OS Ansible Core collection version 1.15.0 is now GA!!

By Oscar Fernando Flores Garcia posted Tue September 30, 2025 05:57 PM

  
We’re pleased to announce the General Availability of IBM z/OS Core Collection version 1.15.0, a release that delivers key enhancements, expanded module capabilities, and important fixes to make z/OS automation more efficient and reliable. This update introduces new encoding options in zos_archive, improved GDG handling in zos_copy, and enhanced data set discovery in both zos_find and zos_stat. It also debuts the new zos_replace module, providing robust pattern replacement for USS files and data sets. Whether you’re managing migrated data sets, working with aliases, or modernizing legacy scripts, version 1.15.0 offers the flexibility and control needed to automate with confidence on z/OS.
Most of what you’ll see here will feel familiar if you’ve read the beta release blog, since very little has changed between the beta and GA—but that just means the features were solid and ready to go. Be advised, some of this paragraphs are the same as in the beta blog. 

New Module: zos_replace

 

The new zos_replace module, introduced in version 1.15.0-beta.1 of the IBM z/OS Core Collection, brings powerful and flexible pattern replacement capabilities to z/OS automation. Whether you're working with USS files, sequential data sets, or members of partitioned data sets, this module allows you to search for patterns using regular expressions and replace them with custom strings or remove them entirely. It also supports scoped replacements using before and after markers, giving you precise control over where changes are applied. With built-in backup options and support for encoding, zos_replace is ideal for safely editing configuration files, JCL, or log data.

  

Here’s a practical example: suppose you want to clean up a USS file by replacing all occurrences of the string profile/ to new_profile/. You can do this with a simple playbook task:

- name: Replace with blank space on a USS file any occurrences of the regex
  zos_replace:
    target: /tmp/src/somefile
    regexp: 'profile\/'
    replace: 'new_profile/'
  
This task scans the file and removes every match of the pattern. You can also combine it with backup: true to preserve the original file before making changes. Whether you're modernizing legacy scripts or automating routine edits, zos_replace makes it easier and safer than ever.
If you are familiar with how replace module works in the ansible builtin collection this module is pretty similar to that and the options are 1 on 1 functionality, except for one very important option literal. This option allows you to give a list of possible values regexp, after and before, each of this values correspond to a module option, all of them are regular expressions used to find either the strings to replace, the start of the search block and the end of the search block, but when those are added in literal the values are treated as literals, so no more trying to make complicated regular expresions in JCL or similar!
We've also added a new entry in the samples playbook repository using zos_replace module which is available here.

  

  

Enhancements. 

- zos_archive.
 
  - Introduced support for encoding files before archiving. Giving users the ability to skip specific files when using the encoding options, also, the source files will revert the encoding after archiving.  
  
zos_copy.
  
  - New identical_gdg_copy option to preserve GDG generation names when copying to a new base.
  - Support for alias names in src and dest for PS, PDS, and PDSE data sets.
  - Documentation updated to reflect binary destination block size change from 32760 to 32720.
  - Added support for British pound (£) character in file content and data set names.
  - Documentation now includes guidance on recalling migrated data sets.   
  
- zos_find.
  
  - Enhanced to locate migrated data sets.
  - Can now search multiple data set types simultaneously.  
  
- zos_mvs_raw.
  
  - Added reserved_cols option to allow content in columns 1 and 2, previously reserved for JCL.
  - Support for volume data definition.
  - Example added for recalling migrated data sets.  
  
- zos_lineinfile.
  
  - Ensures consistent return of return_content and backup_name in responses.  
  
- zos_stat.
  
  - Now supports recalling migrated data sets.
  - Introduced new fields: isfile, isdataset, isaggregate, and isgdg.
  - Added exists field to indicate resource presence on the managed node.  
  
- zos_tso_cmd.
  
  - Example added for recalling migrated data sets.  
  
- zos_unarchive.
  
  - Encoding support added to allow encoding files after unarchiving.  
  

Bugfixes. 

  
- zos_backup_restore.
  
  - Fixed issue where backup_name was not returned upon success.  
  
- zos_data_set.
  
  - Creating a data set with the same name on a different volume now correctly reports failure and guides users to uncatalog the existing data set.  
  
- zos_stat.
  
  - Added support to query data sets using aliases.  
  
- zos_fetch.
  
  - Fixed permission errors when using become to fetch data sets or members.  
  
- zos_lineinfile.
  
  - Corrected false negatives when special characters were present in the line option.  
  
  
Got questions or feedback?  
Drop by our GitHub discussions or open issues at: https://github.com/ansible-collections/ibm_zos_core/issues  
  
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
  • Oscar Fernando Flores Garcia
  • Ivan Alejandro Moreno Soto
  • Andre Marcel Gutierrez Benitez
  • 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
17 views

Permalink