Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ body:
description: Which version of z/OS Ansible core collection are you using. If you are unsure, review the [documentation](https://ibm.github.io/z_ansible_collections_doc/faqs/faqs.html#how-do-i-update-a-collection-to-the-latest-version).
multiple: false
options:
- v1.15.0
- v1.15.0-beta.1
- v1.14.1
- v1.14.0
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/collaboration_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ body:
description: Which version of z/OS Ansible core collection are you using. If you are unsure, review the [documentation](https://ibm.github.io/z_ansible_collections_doc/faqs/faqs.html#how-do-i-update-a-collection-to-the-latest-version).
multiple: false
options:
- v1.15.0
- v1.15.0-beta.1
- v1.14.1
- v1.14.0
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/doc_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ body:
description: Which version of z/OS Ansible core collection are you using. If you are unsure, review the [documentation](https://ibm.github.io/z_ansible_collections_doc/faqs/faqs.html#how-do-i-update-a-collection-to-the-latest-version).
multiple: false
options:
- v1.15.0
- v1.15.0-beta.1
- v1.14.1
- v1.14.0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ shell_exploits.txt
importer_result.json
ac
scripts/
collections/

################################################################################
# Debugging .ignore, if you want to know why a particular file is being ignored
Expand Down
53 changes: 51 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,57 @@ ibm.ibm\_zos\_core Release Notes

.. contents:: Topics

v1.15.0-beta.1
==============
v1.15.0
=======

Release Summary
---------------

Release Date: '2025-09-30'
This changelog describes all changes made to the modules and plugins included
in this collection. The release date is the date the changelog is created.
For additional details such as required dependencies and availability review
the collections `release notes <https://ibm.github.io/z_ansible_collections_doc/ibm_zos_core/docs/source/release_notes.html>`__

Minor Changes
-------------

- zos_archive - Adds support for encoding before archiving files. (https://github.com/ansible-collections/ibm_zos_core/pull/2081)
- zos_archive - Adds support for reverting the encoding of a source's files after archiving them. (https://github.com/ansible-collections/ibm_zos_core/pull/2192)
- zos_archive - Adds support for skipping encoding in archive module. This allows users to skip encoding for certain files before archiving them. (https://github.com/ansible-collections/ibm_zos_core/pull/2116)
- zos_copy - Added support for british pound character usage in file content and data set names for both source and destination when copying. (https://github.com/ansible-collections/ibm_zos_core/pull/2153)
- zos_copy - Adds new option `identical_gdg_copy` in the module. This allows copying GDG generations from a source base to a destination base while preserving generation data set absolute names when the destination base does not exist prior to the copy. (https://github.com/ansible-collections/ibm_zos_core/pull/2100).
- zos_copy - Adds support of using alias names in src and dest parameters for PS, PDS and PDSE data sets. (https://github.com/ansible-collections/ibm_zos_core/pull/2103)
- zos_fetch - Updated the documentation to correctly state what the default behavior of the module is. (https://github.com/ansible-collections/ibm_zos_core/pull/2047).
- zos_find - Adds functionality to find migrated data sets. - Adds functionality to find different types of data sets at the same time. (https://github.com/ansible-collections/ibm_zos_core/pull/2073).
- zos_job_output - Adds new fields cpu_time, origin_node and execution_node to response. (https://github.com/ansible-collections/ibm_zos_core/pull/2056).
- zos_job_query - Adds new fields cpu_time, origin_node and execution_node to response. (https://github.com/ansible-collections/ibm_zos_core/pull/2056).
- zos_job_submit - Adds new fields cpu_time, origin_node and execution_node to response. (https://github.com/ansible-collections/ibm_zos_core/pull/2056).
- zos_mvs_raw - Before this addition, you could not put anything in columns 1 or 2, were reserved for JCL processing. Change now allows add reserved_cols option and validate that the module get access to modify dd_content option base on the value, if not retain the previous behavior or work. (https://github.com/ansible-collections/ibm_zos_core/pull/2086)
- zos_mvs_raw - Adds support for volume data definition. (https://github.com/ansible-collections/ibm_zos_core/pull/2194)
- zos_stat - Added support to recall migrated data sets and return its attributes. (https://github.com/ansible-collections/ibm_zos_core/pull/2075)
- zos_stat - Adds new fields that describe the type of the resource that was queried. These new fields are `isfile`, `isdataset`, `isaggregate` and `isgdg`. (https://github.com/ansible-collections/ibm_zos_core/pull/2137)
- zos_stat - Adds support to query data sets using their aliases. (https://github.com/ansible-collections/ibm_zos_core/pull/2061)
- zos_stat - Module now returns whether the resource queried exists on the managed node with the `exists` field inside `stat`. (https://github.com/ansible-collections/ibm_zos_core/pull/2137)
- zos_unarchive - Added encoding support for the unarchive module. This allows users to encode the files after unarchiving them in a perticular encoding. (https://github.com/ansible-collections/ibm_zos_core/pull/2105)

Bugfixes
--------

- zos_backup_restore - Return value `backup_name` was empty upon successful result. Fix now returns `backup_name` populated. (https://github.com/ansible-collections/ibm_zos_core/pull/2040).
- zos_data_set - Attempting to create a data set with the same name on a different volume did not work, nor did it report a failure. The fix now informs the user that if the data set is cataloged on a different volume, it needs to be uncataloged before using the data set module to create a new data set on a different volume. (https://github.com/ansible-collections/ibm_zos_core/pull/2057).
- zos_fetch - Previously, the use of `become` would result in a permissions error while trying to fetch a data set or a member. Fix now allows a user to escalate privileges when fetching resources. (https://github.com/ansible-collections/ibm_zos_core/pull/2079)
- zos_lineinfile - Return values ``return_content`` and ``backup_name`` were not always being returned. Fix now ensure that these values are always present in the module's response. (https://github.com/ansible-collections/ibm_zos_core/pull/2120)
- zos_lineinfile - The module would report a false negative when certain special characters where present in the `line` option. Fix now reports the successful operation. (https://github.com/ansible-collections/ibm_zos_core/pull/2080).
- zos_mount - FSUMF168 return in stderror means that the mount dataset wouldn't resolve. While this shows a catalog or volume issue, it should not impact our search for an existing mount. Added handling to the df call, so that FSUMF168 are ignored. (https://github.com/ansible-collections/ibm_zos_core/pull/2060).

New Modules
-----------

- ibm.ibm_zos_core.zos_replace - Replace all instances of a pattern within a file or data set.

v1.14.1
=======

Release Summary
---------------
Expand Down
14 changes: 7 additions & 7 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -853,23 +853,23 @@ releases:

the collections `release notes <https://ibm.github.io/z_ansible_collections_doc/ibm_zos_core/docs/source/release_notes.html>`__"
fragments:
- 2196-fix-copy-permission-issues.yml
- v1.14.1_summary.yml
release_date: "2025-07-01"
- 2196-fix-copy-permission-issues.yml
- v1.14.1_summary.yml
release_date: '2025-07-01'
1.15.0:
changes:
release_summary: "Release Date: '2025-09-30'
release_summary: 'Release Date: ''2025-09-30''

This changelog describes all changes made to the modules and plugins included

in this collection. The release date is the date the changelog is created.

For additional details such as required dependencies and availability review

the collections `release notes <https://ibm.github.io/z_ansible_collections_doc/ibm_zos_core/docs/source/release_notes.html>`__"
the collections `release notes <https://ibm.github.io/z_ansible_collections_doc/ibm_zos_core/docs/source/release_notes.html>`__'
fragments:
- v1.15.0_summary.yml
release_date: "2025-09-22"
- v1.15.0_summary.yml
release_date: '2025-09-22'
1.15.0-beta.1:
changes:
bugfixes:
Expand Down
3 changes: 3 additions & 0 deletions changelogs/fragments/2206-zos_data_set-interface-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- zos_data_set - Adds return value ``data_sets`` which contains the attributes of all data sets created.
(https://github.com/ansible-collections/ibm_zos_core/pull/2206)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bugfixes:
- zos_mount - Previously, using the persistent parameter caused the module to clear the entire member or data set
provided even without a pattern match, leaving it empty despite a successful mount.
The fix now ensures content is only deleted when a pattern match is detected, preserving existing configuration.
(https://github.com/ansible-collections/ibm_zos_core/pull/2347).
3 changes: 3 additions & 0 deletions changelogs/fragments/2361-update-zos_data_set-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
breaking_changes:
- zos_data_set - Return value ``message`` is deprecated in favor of ``msg``.
(https://github.com/ansible-collections/ibm_zos_core/pull/2361).
4 changes: 2 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,5 @@ build_ignore:
- tests/sanity/ignore-2.14.txt
- venv*
- ansible_collections
- "*.log"
- "*.sh"
- '*.log'
- '*.sh'
12 changes: 7 additions & 5 deletions meta/ibm_zos_core_meta.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: ibm_zos_core
version: "1.15.0"
managed_requirements:
- name: "IBM Open Enterprise SDK for Python"
version: ">=3.12"
- name: "Z Open Automation Utilities"
version:
- ">=1.3.5"
-
name: "IBM Open Enterprise SDK for Python"
version: ">=3.12"
-
name: "Z Open Automation Utilities"
version:
- ">=1.3.5"
77 changes: 68 additions & 9 deletions plugins/module_utils/data_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def ensure_present(
arguments.pop("replace", None)
present = False
changed = False
data_set = None
if DataSet.data_set_cataloged(name, tmphlq=tmp_hlq):
present = True
# Validate volume conflicts when:
Expand All @@ -222,7 +223,7 @@ def ensure_present(

if not present:
try:
DataSet.create(**arguments)
changed, data_set = DataSet.create(**arguments)
except DatasetCreateError as e:
raise_error = True
# data set exists on volume
Expand All @@ -236,11 +237,11 @@ def ensure_present(
raise
if present:
if not replace:
return changed
DataSet.replace(**arguments)
return changed, data_set
changed, data_set = DataSet.replace(**arguments)
if type.upper() == "ZFS":
DataSet.format_zfs(name)
return True
return changed, data_set

@staticmethod
def ensure_absent(name, volumes=None, tmphlq=None, noscratch=False):
Expand Down Expand Up @@ -1249,7 +1250,8 @@ def replace(
"""
arguments = locals()
DataSet.delete(name)
DataSet.create(**arguments)
changed, data_set = DataSet.create(**arguments)
return changed, data_set

@staticmethod
def _build_zoau_args(**kwargs):
Expand Down Expand Up @@ -1417,7 +1419,7 @@ def create(
msg="Unable to verify the data set was created. Received DatasetVerificationError from ZOAU.",
)
changed = data_set is not None
return changed
return changed, data_set

@staticmethod
def delete(name, noscratch=False):
Expand Down Expand Up @@ -2723,7 +2725,9 @@ def ensure_present(self, tmp_hlq=None, replace=False, force=False):
"tmp_hlq": tmp_hlq,
"force": force,
}
rc = DataSet.ensure_present(**arguments)
rc, data_set = DataSet.ensure_present(**arguments)
if data_set is not None:
self.merge_attributes_from_zoau_data_set(data_set)
self.set_state("present")
return rc

Expand Down Expand Up @@ -2843,6 +2847,37 @@ def set_state(self, new_state):
raise ValueError(f"State {self.state} not supported for MVSDataset class.")
return True

def merge_attributes_from_zoau_data_set(self, zoau_data_set):
# print(zoau_data_set)
self.name = zoau_data_set.name
self.record_format = zoau_data_set.record_format and zoau_data_set.record_format.lower()
self.record_length = zoau_data_set.record_length
self.volumes = zoau_data_set.volume and zoau_data_set.volume.lower()
self.block_size = zoau_data_set.block_size
self.type = zoau_data_set.type and zoau_data_set.type.lower()

@property
def attributes(self):
data_set_attributes = {
"name": self.name,
"state": self.state,
"type": self.data_set_type,
"space_primary": self.space_primary,
"space_secondary": self.space_secondary,
"space_type": self.space_type,
"record_format": self.record_format,
"sms_storage_class": self.sms_storage_class,
"sms_data_class": self.sms_data_class,
"sms_management_class": self.sms_management_class,
"record_length": self.record_length,
"block_size": self.block_size,
"directory_blocks": self.directory_blocks,
"key_offset": self.key_offset,
"key_length": self.key_length,
"volumes": self.volumes,
}
return data_set_attributes


class Member():
"""Represents a member on z/OS.
Expand Down Expand Up @@ -2899,6 +2934,15 @@ def ensure_present(self, replace=None, tmphlq=None):
rc = DataSet.ensure_member_present(self.name, replace, tmphlq=tmphlq)
return rc

@property
def attributes(self):
member_attributes = {
"name": self.name,
"parent_data_set_type": self.parent_data_set_type,
"data_set_type": self.data_set_type,
}
return member_attributes


class GenerationDataGroup():
"""Represents a Generation Data Group base in z/OS.
Expand Down Expand Up @@ -2947,8 +2991,7 @@ def __init__(
self.data_set_type = "gdg"
self.raw_name = name
self.gdg = None
# Removed escaping since is not needed by the GDG python api.
# self.name = DataSet.escape_data_set_name(self.name)
self.state = 'present'

@staticmethod
def _validate_gdg_name(name):
Expand Down Expand Up @@ -2977,6 +3020,7 @@ def create(self):
fifo=self.fifo,
)
self.gdg = gdg
self.state = 'present'
return True

def ensure_present(self, replace):
Expand Down Expand Up @@ -3097,6 +3141,21 @@ def clear(self):
gdg_view.clear()
return True

@property
def attributes(self):
data_set_attributes = {
"name": self.name,
"state": self.state,
"type": self.data_set_type,
"empty": self.empty,
"extended": self.extended,
"fifo": self.fifo,
"limit": self.limit,
"purge": self.purge,
"scratch": self.scratch,
}
return data_set_attributes


def is_member(data_set):
"""Determine whether the input string specifies a data set member.
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/zos_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ def _create_dest_data_set(
if space_type is None:
arguments.update(space_type="m")
arguments.pop("self")
changed = data_set.DataSet.ensure_present(**arguments)
changed, zoau_data_set = data_set.DataSet.ensure_present(**arguments)
return arguments["name"], changed

def create_dest_ds(self, name):
Expand Down
Loading