ibm / ibm.ibm_zos_core / 1.9.0 / module / zos_archive Archive files and data sets on z/OS. | "added in version" 1.7.0 of ibm.ibm_zos_core" Authors: Oscar Fernando Flores Garcia (@fernandofloresg)ibm.ibm_zos_core.zos_archive (1.9.0) — module
Install with ansible-galaxy collection install ibm.ibm_zos_core:==1.9.0
collections: - name: ibm.ibm_zos_core version: 1.9.0
Create or extend an archive on a remote z/OS system.
Sources for archiving must be on the remote z/OS system.
Supported sources are USS (UNIX System Services) or z/OS data sets.
The archive remains on the remote z/OS system.
For supported archive formats, see option C(format).
# Simple archive - name: Archive file into a tar zos_archive: src: /tmp/archive/foo.txt dest: /tmp/archive/foo_archive_test.tar format: name: tar
# Archive multiple files - name: Compress list of files into a zip zos_archive: src: - /tmp/archive/foo.txt - /tmp/archive/bar.txt dest: /tmp/archive/foo_bar_archive_test.zip format: name: zip
# Archive one data set into terse - name: Compress data set into a terse zos_archive: src: "USER.ARCHIVE.TEST" dest: "USER.ARCHIVE.RESULT.TRS" format: name: terse
# Use terse with different options - name: Compress data set into a terse, specify pack algorithm and use adrdssu zos_archive: src: "USER.ARCHIVE.TEST" dest: "USER.ARCHIVE.RESULT.TRS" format: name: terse format_options: terse_pack: "SPACK" use_adrdssu: True
# Use a pattern to store - name: Compress data set pattern using xmit zos_archive: src: "USER.ARCHIVE.*" exclude_sources: "USER.ARCHIVE.EXCLUDE.*" dest: "USER.ARCHIVE.RESULT.XMIT" format: name: xmit
src: description: - List of names or globs of UNIX System Services (USS) files, PS (sequential data sets), PDS, PDSE to compress or archive. - USS file paths should be absolute paths. - 'MVS data sets supported types are: C(SEQ), C(PDS), C(PDSE).' - VSAMs are not supported. elements: str required: true type: list dest: description: - The remote absolute path or data set where the archive should be created. - I(dest) can be a USS file or MVS data set name. - If I(dest) has missing parent directories, they will be created. - If I(dest) is a nonexistent USS file, it will be created. - If I(dest) is an existing file or data set and I(force=true), the existing I(dest) will be deleted and recreated with attributes defined in the I(dest_data_set) option or computed by the module. - If I(dest) is an existing file or data set and I(force=false) or not specified, the module exits with a note to the user. - Destination data set attributes can be set using I(dest_data_set). - Destination data set space will be calculated based on space of source data sets provided and/or found by expanding the pattern name. Calculating space can impact module performance. Specifying space attributes in the I(dest_data_set) option will improve performance. required: true type: str mode: description: - The permission of the destination archive file. - If C(dest) is USS, this will act as Unix file mode, otherwise ignored. - It should be noted that modes are octal numbers. The user must either add a leading zero so that Ansible's YAML parser knows it is an octal number (like C(0644) or C(01777))or quote it (like C('644') or C('1777')) so Ansible receives a string and can do its own conversion from string into number. Giving Ansible a number without following one of these rules will end up with a decimal number which will have unexpected results. - The mode may also be specified as a symbolic mode (for example, 'u+rwx' or 'u=rw,g=r,o=r') or a special string 'preserve'. - I(mode=preserve) means that the file will be given the same permissions as the src file. required: false type: str force: default: false description: - If set to C(true) and the remote file or data set C(dest) will be deleted. Otherwise it will be created with the C(dest_data_set) attributes or default values if C(dest_data_set) is not specified. - If set to C(false), the file or data set will only be copied if the destination does not exist. - If set to C(false) and destination exists, the module exits with a note to the user. required: false type: bool group: description: - Name of the group that will own the archive file. - When left unspecified, it uses the current group of the current use unless you are root, in which case it can preserve the previous ownership. - This option is only applicable if C(dest) is USS, otherwise ignored. required: false type: str owner: description: - Name of the user that should own the archive file, as would be passed to the chown command. - When left unspecified, it uses the current user unless you are root, in which case it can preserve the previous ownership. - This option is only applicable if C(dest) is USS, otherwise ignored. required: false type: str format: description: - The compression type and corresponding options to use when archiving data. required: false suboptions: format_options: description: - Options specific to a compression format. required: false suboptions: terse_pack: choices: - PACK - SPACK description: - Compression option for use with the terse format, I(name=terse). - Pack will compress records in a data set so that the output results in lossless data compression. - Spack will compress records in a data set so the output results in complex data compression. - Spack will produce smaller output and take approximately 3 times longer than pack compression. required: false type: str use_adrdssu: default: false description: - If set to true, the C(zos_archive) module will use Data Facility Storage Management Subsystem data set services (DFSMSdss) program ADRDSSU to compress data sets into a portable format before using C(xmit) or C(terse). type: bool xmit_log_data_set: description: - Provide the name of a data set to store xmit log output. - If the data set provided does not exist, the program will create it. - 'If the data set provided exists, the data set must have the following attributes: LRECL=255, BLKSIZE=3120, and RECFM=VB' - When providing the I(xmit_log_data_set) name, ensure there is adequate space. type: str type: dict name: choices: - bz2 - gz - tar - zip - terse - xmit - pax default: gz description: - The compression format to use. required: false type: str type: dict remove: default: false description: - Remove any added source files , trees or data sets after module L(zos_archive,./zos_archive.html) adds them to the archive. Source files, trees and data sets are identified with option I(src). required: false type: bool exclude: description: - Remote absolute path, glob, or list of paths, globs or data set name patterns for the file, files or data sets to exclude from src list and glob expansion. - Patterns (wildcards) can contain one of the following, `?`, `*`. - '* matches everything.' - '? matches any single character.' elements: str required: false type: list tmp_hlq: description: - Override the default high level qualifier (HLQ) for temporary data sets. - The default HLQ is the Ansible user used to execute the module and if that is not available, then the environment variable value C(TMPHLQ) is used. required: false type: str dest_data_set: description: - Data set attributes to customize a C(dest) data set to be archived into. required: false suboptions: block_size: description: - The block size to use for the data set. required: false type: int directory_blocks: description: - The number of directory blocks to allocate to the data set. required: false type: int name: description: - Desired name for destination dataset. required: false type: str record_format: choices: - FB - VB - FBA - VBA - U description: - If the destination data set does not exist, this sets the format of the data set. (e.g C(FB)) - Choices are case-insensitive. required: false type: str record_length: description: - The length of each record in the data set, in bytes. - For variable data sets, the length must include the 4-byte prefix area. - 'Defaults vary depending on format: If FB/FBA 80, if VB/VBA 137, if U 0.' required: false type: int sms_data_class: description: - The data class for an SMS-managed dataset. - Optional for SMS-managed datasets that do not match an SMS-rule. - Not valid for datasets that are not SMS-managed. - Note that all non-linear VSAM datasets are SMS-managed. required: false type: str sms_management_class: description: - The management class for an SMS-managed dataset. - Optional for SMS-managed datasets that do not match an SMS-rule. - Not valid for datasets that are not SMS-managed. - Note that all non-linear VSAM datasets are SMS-managed. required: false type: str sms_storage_class: description: - The storage class for an SMS-managed dataset. - Required for SMS-managed datasets that do not match an SMS-rule. - Not valid for datasets that are not SMS-managed. - Note that all non-linear VSAM datasets are SMS-managed. required: false type: str space_primary: description: - If the destination I(dest) data set does not exist , this sets the primary space allocated for the data set. - The unit of space used is set using I(space_type). required: false type: int space_secondary: description: - If the destination I(dest) data set does not exist , this sets the secondary space allocated for the data set. - The unit of space used is set using I(space_type). required: false type: int space_type: choices: - K - M - G - CYL - TRK description: - If the destination data set does not exist, this sets the unit of measurement to use when defining primary and secondary space. - Valid units of size are C(K), C(M), C(G), C(CYL), and C(TRK). required: false type: str type: choices: - SEQ default: SEQ description: - Organization of the destination required: false type: str type: dict
archived: description: - Any files or data sets that were compressed or added to the archive. returned: success type: list arcroot: description: - If C(src) is a list of USS files, this returns the top most parent folder of the list of files, otherwise is empty. returned: always type: str dest_state: description: - The state of the I(dest) file or data set. - C(absent) when the file does not exist. - C(archive) when the file is an archive. - C(compress) when the file is compressed, but not an archive. - C(incomplete) when the file is an archive, but some files under I(src) were not found. returned: success type: str expanded_exclude_sources: description: The list of matching exclude paths from the exclude option. returned: always type: list expanded_sources: description: The list of matching paths from the src option. returned: always type: list missing: description: Any files or data sets that were missing from the source. returned: success type: list state: description: - The state of the input C(src). - C(absent) when the source files or data sets were removed. - C(present) when the source files or data sets were not removed. - C(incomplete) when C(remove) was true and the source files or data sets were not removed. returned: always type: str