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.
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.
Ready to Try It?
This is a beta release, so while it’s not yet production-certified, it’s a great opportunity to explore new features and provide feedback. If you’ve been looking for better control over GDGs, encoding flexibility, or improved data set discovery—v1.15.0-beta.1 is worth a spin.
You can install the beta version using:
ansible-galaxy collection install ibm.ibm_zos_core:1.15.0-beta.1.
Let us know what you think, and stay tuned for the full production release!
Got questions or feedback?
Drop by our GitHub discussions or open issues at: https://github.com/ansible-collections/ibm_zos_core/issues