From e2ad0ee14c9a4132563b262431af0602ff19fe30 Mon Sep 17 00:00:00 2001 From: Rich Parker Date: Thu, 14 Sep 2023 14:56:55 -0400 Subject: [PATCH 1/5] Initial commit to add LIBRARY to choices and docs --- changelogs/fragments/920-zos-copy-add-library-choice.yml | 4 ++++ plugins/modules/zos_copy.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/920-zos-copy-add-library-choice.yml diff --git a/changelogs/fragments/920-zos-copy-add-library-choice.yml b/changelogs/fragments/920-zos-copy-add-library-choice.yml new file mode 100644 index 000000000..cb30191c1 --- /dev/null +++ b/changelogs/fragments/920-zos-copy-add-library-choice.yml @@ -0,0 +1,4 @@ +bugfixes: +- zos_copy - Update option limit to include LIBRARY as dest_dataset/suboption value. + Documentation updated to reflect this change. + (https://github.com/ansible-collections/ibm_zos_core/pull/). \ No newline at end of file diff --git a/plugins/modules/zos_copy.py b/plugins/modules/zos_copy.py index aabd5447e..b87845fab 100644 --- a/plugins/modules/zos_copy.py +++ b/plugins/modules/zos_copy.py @@ -283,6 +283,7 @@ - PDSE - MEMBER - BASIC + - LIBRARY space_primary: description: - If the destination I(dest) data set does not exist , this sets the @@ -2741,7 +2742,7 @@ def main(): type=dict( type='str', choices=['BASIC', 'KSDS', 'ESDS', 'RRDS', - 'LDS', 'SEQ', 'PDS', 'PDSE', 'MEMBER'], + 'LDS', 'SEQ', 'PDS', 'PDSE', 'MEMBER', 'LIBRARY'], required=True, ), space_primary=dict( From 7515e8ce4a2354fc6eb3b441a9cc469909db6328 Mon Sep 17 00:00:00 2001 From: Rich Parker Date: Thu, 14 Sep 2023 15:01:50 -0400 Subject: [PATCH 2/5] added PR value to fragment --- changelogs/fragments/920-zos-copy-add-library-choice.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/920-zos-copy-add-library-choice.yml b/changelogs/fragments/920-zos-copy-add-library-choice.yml index cb30191c1..2d339227b 100644 --- a/changelogs/fragments/920-zos-copy-add-library-choice.yml +++ b/changelogs/fragments/920-zos-copy-add-library-choice.yml @@ -1,4 +1,4 @@ bugfixes: - zos_copy - Update option limit to include LIBRARY as dest_dataset/suboption value. Documentation updated to reflect this change. - (https://github.com/ansible-collections/ibm_zos_core/pull/). \ No newline at end of file + (https://github.com/ansible-collections/ibm_zos_core/pull/968). \ No newline at end of file From e6321bfb91e0ac815072358c23cf56ccc4fc7b97 Mon Sep 17 00:00:00 2001 From: Rich Parker Date: Thu, 21 Sep 2023 10:08:03 -0400 Subject: [PATCH 3/5] added changelog for ticket --- .../fragments/920-bug-add-library-feature-documentation.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/fragments/920-bug-add-library-feature-documentation.yml diff --git a/changelogs/fragments/920-bug-add-library-feature-documentation.yml b/changelogs/fragments/920-bug-add-library-feature-documentation.yml new file mode 100644 index 000000000..efafd82bc --- /dev/null +++ b/changelogs/fragments/920-bug-add-library-feature-documentation.yml @@ -0,0 +1,4 @@ +bugfixes: + - zos_copy: Add 'LIBRARY' option as a destination dataset suboption. + Update documentation to show this option. + (https://github.com/ansible-collections/ibm_zos_core/pull/968) From 4d033385b0d1be275623c30ae45fcf0c9ad13628 Mon Sep 17 00:00:00 2001 From: Rich Parker Date: Wed, 4 Oct 2023 10:11:18 -0400 Subject: [PATCH 4/5] removed redundant changelog fragment --- .../fragments/920-bug-add-library-feature-documentation.yml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 changelogs/fragments/920-bug-add-library-feature-documentation.yml diff --git a/changelogs/fragments/920-bug-add-library-feature-documentation.yml b/changelogs/fragments/920-bug-add-library-feature-documentation.yml deleted file mode 100644 index efafd82bc..000000000 --- a/changelogs/fragments/920-bug-add-library-feature-documentation.yml +++ /dev/null @@ -1,4 +0,0 @@ -bugfixes: - - zos_copy: Add 'LIBRARY' option as a destination dataset suboption. - Update documentation to show this option. - (https://github.com/ansible-collections/ibm_zos_core/pull/968) From 36e6368a96c963309f91e44db9a4330db7fc5250 Mon Sep 17 00:00:00 2001 From: ddimatos Date: Thu, 5 Oct 2023 22:46:11 -0700 Subject: [PATCH 5/5] push updated module doc Signed-off-by: ddimatos --- docs/source/modules/zos_copy.rst | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/source/modules/zos_copy.rst b/docs/source/modules/zos_copy.rst index 45dee10a7..71cd094fc 100644 --- a/docs/source/modules/zos_copy.rst +++ b/docs/source/modules/zos_copy.rst @@ -74,7 +74,7 @@ dest If ``dest`` is a nonexistent data set, it will be created following the process outlined here and in the ``volume`` option. - If ``dest`` is a nonexistent data set, the attributes assigned will depend on the type of ``src``. If ``src`` is a USS file, ``dest`` will have a Fixed Block (FB) record format and the remaining attributes will be computed. If ``src`` is binary, ``dest`` will have a Fixed Block (FB) record format with a record length of 80, block size of 32760, and the remaining attributes will be computed. + If ``dest`` is a nonexistent data set, the attributes assigned will depend on the type of ``src``. If ``src`` is a USS file, ``dest`` will have a Fixed Block (FB) record format and the remaining attributes will be computed. If *is_binary=true*, ``dest`` will have a Fixed Block (FB) record format with a record length of 80, block size of 32760, and the remaining attributes will be computed. If *executable=true*,``dest`` will have an Undefined (U) record format with a record length of 0, block size of 32760, and the remaining attributes will be computed. When ``dest`` is a data set, precedence rules apply. If ``dest_data_set`` is set, this will take precedence over an existing data set. If ``dest`` is an empty data set, the empty data set will be written with the expectation its attributes satisfy the copy. Lastly, if no precendent rule has been exercised, ``dest`` will be created with the same attributes of ``src``. @@ -156,6 +156,21 @@ is_binary | **type**: bool +executable + If set to ``true``, indicates that the file or library to be copied is an executable. + + If the ``src`` executable has an alias, the alias information is also copied. If the ``dest`` is Unix, the alias is not visible in Unix, even though the information is there and will be visible if copied to a library. + + If *executable=true*, and ``dest`` is a data set, it must be a PDS or PDSE (library). + + If ``dest`` is a nonexistent data set, the library attributes assigned will be Undefined (U) record format with a record length of 0, block size of 32760 and the remaining attributes will be computed. + + If ``dest`` is a file, execute permission for the user will be added to the file (``u+x``). + + | **required**: False + | **type**: bool + + local_follow This flag indicates that any existing filesystem links in the source tree should be followed. @@ -247,7 +262,7 @@ dest_data_set | **required**: True | **type**: str - | **choices**: KSDS, ESDS, RRDS, LDS, SEQ, PDS, PDSE, MEMBER, BASIC + | **choices**: KSDS, ESDS, RRDS, LDS, SEQ, PDS, PDSE, MEMBER, BASIC, LIBRARY space_primary @@ -672,6 +687,13 @@ Examples record_format: VB record_length: 150 + - name: Copy a Program Object on remote system to a new PDSE member MYCOBOL. + zos_copy: + src: HLQ.COBOLSRC.PDSE(TESTPGM) + dest: HLQ.NEW.PDSE(MYCOBOL) + remote_src: true + executable: true + @@ -691,6 +713,8 @@ Notes `zos_copy <./zos_copy.html>`_ uses SFTP (Secure File Transfer Protocol) for the underlying transfer protocol; Co:Z SFTP is not supported. In the case of Co:z SFTP, you can exempt the Ansible userid on z/OS from using Co:Z thus falling back to using standard SFTP. + Beginning in version 1.8.x, zos_copy will no longer attempt to autocorrect a copy of a data type member into a PDSE that contains program objects. You can control this behavior using module option executable that will signify an executable is being copied into a PDSE with other executables. Mixing data type members with program objects will be responded with a (FSUM8976,./zos_copy.html) error. + See Also