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..2d339227b --- /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/968). \ No newline at end of file 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 diff --git a/plugins/modules/zos_copy.py b/plugins/modules/zos_copy.py index 073e11688..10b35ea22 100644 --- a/plugins/modules/zos_copy.py +++ b/plugins/modules/zos_copy.py @@ -299,6 +299,7 @@ - PDSE - MEMBER - BASIC + - LIBRARY space_primary: description: - If the destination I(dest) data set does not exist , this sets the @@ -2787,7 +2788,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(