Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit to add LIBRARY to choices and docs #968

Merged
merged 8 commits into from
Oct 10, 2023
Merged
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
4 changes: 4 additions & 0 deletions changelogs/fragments/920-zos-copy-add-library-choice.yml
Original file line number Diff line number Diff line change
@@ -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).
28 changes: 26 additions & 2 deletions docs/source/modules/zos_copy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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




Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion plugins/modules/zos_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@
- PDSE
- MEMBER
- BASIC
- LIBRARY
space_primary:
description:
- If the destination I(dest) data set does not exist , this sets the
Expand Down Expand Up @@ -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(
Expand Down