zos_mount – Mount a z/OS file system.¶
Synopsis¶
The module zos_mount can manage mount operations for a z/OS UNIX System Services (USS) file system data set.
The src data set must be unique and a Fully Qualified Name (FQN).
The path will be created if needed.
Parameters¶
- path
The absolute path name onto which the file system is to be mounted.
The path is case sensitive and must be less than or equal 1023 characters long.
required: Truetype: str- src
The name of the file system to be added to the file system hierarchy.
The file system src must be a data set of type fs_type.
The file system src data set must be cataloged.
required: Truetype: str- fs_type
The type of file system that will be mounted.
The physical file systems data set format to perform the logical mount.
The fs_type is required to be uppercase.
required: Truetype: strchoices: HFS, ZFS, NFS, TFS- state
The desired status of the described mount (choice).
If state=mounted and src are not in use, the module will add the file system entry to the parmlib member persistent/data_store if not present. The path will be updated, the device will be mounted and the module will complete successfully with changed=True.
If state=mounted and src are in use, the module will add the file system entry to the parmlib member persistent/data_store if not present. The path will not be updated, the device will not be mounted and the module will complete successfully with changed=False.
If state=unmounted and src are in use, the module will not add the file system entry to the parmlib member persistent/data_store. The device will be unmounted and the module will complete successfully with changed=True.
If state=unmounted and src are not in use, the module will not add the file system entry to parmlib member persistent/data_store.The device will remain unchanged and the module will complete with changed=False.
If state=present, the module will add the file system entry to the provided parmlib member persistent/data_store if not present. The module will complete successfully with changed=True.
If state=absent, the module will remove the file system entry to the provided parmlib member persistent/data_store if present. The module will complete successfully with changed=True.
If state=remounted, the module will not add the file system entry to parmlib member persistent/data_store. The device will be unmounted and mounted, the module will complete successfully with changed=True.
required: Falsetype: strdefault: mountedchoices: absent, mounted, unmounted, present, remounted- persistent
Add or remove mount command entries to provided data_store
required: Falsetype: dict- data_store
The data set name used for persisting a mount command. This is usually BPXPRMxx or a copy.
required: Truetype: str- backup
Creates a backup file or backup data set for data_store, including the timestamp information to ensure that you retrieve the original parameters defined in data_store.
backup_name can be used to specify a backup file name if backup=true.
The backup file name will be returned on either success or failure of module execution such that data can be retrieved.
required: Falsetype: booldefault: False- backup_name
Specify the USS file name or data set name for the destination backup.
If the source data_store is a USS file or path, the backup_name name can be relative or absolute for file or path name.
If the source is an MVS data set, the backup_name must be an MVS data set name.
If the backup_name is not provided, the default backup_name will be used. If the source is a USS file or path, the name of the backup file will be the source file or path name appended with a timestamp. For example,
/path/file_name.2020-04-23-08-32-29-bak.tar
.If the source is an MVS data set, it will be a data set with a random name generated by calling the ZOAU API. The MVS backup data set recovery can be done by renaming it.
required: Falsetype: str- comment
If provided, this is used as a comment that surrounds the command in the persistent/data_store
Comments are used to encapsulate the persistent/data_store entry such that they can easily be understood and located.
required: Falsetype: listelements: str
- unmount_opts
Describes how the unmount will be performed.
For more on coded character set identifiers, review the IBM documentation topic UNMOUNT - Remove a file system from the file hierarchy.
required: Falsetype: strdefault: NORMALchoices: DRAIN, FORCE, IMMEDIATE, NORMAL, REMOUNT, RESET- mount_opts
Options available to the mount.
If mount_opts=RO on a mounted/remount, mount is performed read-only.
If mount_opts=SAME and (unmount_opts=REMOUNT), mount is opened in the same mode as previously opened.
If mount_opts=NOWAIT, mount is performed asynchronously.
If mount_opts=NOSECURITY, security checks are not enforced for files in this file system.
required: Falsetype: strdefault: RWchoices: RO, RW, SAME, NOWAIT, NOSECURITY- src_params
Specifies a parameter string to be passed to the file system type.
The parameter format and content are specified by the file system type.
required: Falsetype: str- tag_untagged
If present, tags get written to any untagged file.
When the file system is unmounted, the tags are lost.
If tag_untagged=NOTEXT none of the untagged files in the file system are automatically converted during file reading and writing.
If tag_untagged=TEXT each untagged file is implicitly marked as containing pure text data that can be converted.
If this flag is used, use of tag_ccsid is encouraged.
required: Falsetype: strchoices: TEXT, NOTEXT- tag_ccsid
Identifies the coded character set identifier (ccsid) to be implicitly set for the untagged file.
For more on coded character set identifiers, review the IBM documentation topic Coded Character Sets.
Specified as a decimal value from 0 to 65535. However, when TEXT is specified, the value must be between 0 and 65535.
The value is not checked as being valid and the corresponding code page is not checked as being installed.
Required when tag_untagged=TEXT.
required: Falsetype: int- allow_uid
Specifies whether the SETUID and SETGID mode bits on an executable in this file system are considered. Also determines whether the APF extended attribute or the Program Control extended attribute is honored.
If allow_uid=True the SETUID and SETGID mode bits are considered when a program in this file system is run. SETUID is the default.
If allow_uid=False the SETUID and SETGID mode bits are ignored when a program in this file system is run. The program runs as though the SETUID and SETGID mode bits were not set. Also, if you specify the NOSETUID option on MOUNT, the APF extended attribute and the Program Control Bit values are ignored.
required: Falsetype: booldefault: True- sysname
For systems participating in shared file system, sysname specifies the particular system on which a mount should be performed. This system will then become the owner of the file system mounted. This system must be IPLed with SYSPLEX(YES).
sysname is the name of a system participating in shared file system. The name must be 1-8 characters long; the valid characters are A-Z, 0-9, $, @, and #.
required: Falsetype: str- automove
These parameters apply only in a sysplex where systems are exploiting the shared file system capability. They specify what happens to the ownership of a file system when a shutdown, PFS termination, dead system takeover, or file system move occurs. The default setting is AUTOMOVE where the file system will be randomly moved to another system (no system list used).
automove=AUTOMOVE indicates that ownership of the file system can be automatically moved to another system participating in a shared file system.
automove=NOAUTOMOVE prevents movement of the file system’s ownership in some situations.
automove=UNMOUNT allows the file system to be unmounted in some situations.
required: Falsetype: strdefault: AUTOMOVEchoices: AUTOMOVE, NOAUTOMOVE, UNMOUNT- automove_list
If(automove=AUTOMOVE), this option will be checked.
This specifies the list of servers to include or exclude as destinations.
None is a valid value, meaning ‘move anywhere’.
Indicator is either INCLUDE or EXCLUDE, which can also be abbreviated as I or E.
required: Falsetype: str- tmp_hlq
Override the default high level qualifier (HLQ) for temporary and backup datasets.
The default HLQ is the Ansible user used to execute the module and if that is not available, then the value
TMPHLQ
is used.required: Falsetype: str
Examples¶
- name: Mount a filesystem.
zos_mount:
src: SOMEUSER.VVV.ZFS
path: /u/omvsadm/core
fs_type: ZFS
state: mounted
- name: Unmount a filesystem.
zos_mount:
src: SOMEUSER.VVV.ZFS
path: /u/omvsadm/core
fs_type: ZFS
state: unmounted
unmount_opts: REMOUNT
opts: same
- name: Mount a filesystem readonly.
zos_mount:
src: SOMEUSER.VVV.ZFS
path: /u/omvsadm/core
fs_type: ZFS
state: mounted
mount_opts: RO
- name: Mount a filesystem and record change in BPXPRMAA.
zos_mount:
src: SOMEUSER.VVV.ZFS
path: /u/omvsadm/core
fs_type: ZFS
state: mounted
persistent:
data_store: SYS1.PARMLIB(BPXPRMAA)
comment: For Tape2 project
- name: Mount a filesystem and record change in BPXPRMAA after backing up to BPXPRMAB.
zos_mount:
src: SOMEUSER.VVV.ZFS
path: /u/omvsadm/core
fs_type: ZFS
state: mounted
persistent:
data_store: SYS1.PARMLIB(BPXPRMAA)
backup: Yes
backup_name: SYS1.PARMLIB(BPXPRMAB)
comment: For Tape2 project
- name: Mount a filesystem ignoring uid/gid values.
zos_mount:
src: SOMEUSER.VVV.ZFS
path: /u/omvsadm/core
fs_type: ZFS
state: mounted
allow_uid: no
- name: Mount a filesystem asynchronously (don't wait for completion).
zos_mount:
src: SOMEUSER.VVV.ZFS
path: /u/omvsadm/core
fs_type: ZFS
state: mounted
opts: nowait
- name: Mount a filesystem with no security checks.
zos_mount:
src: SOMEUSER.VVV.ZFS
path: /u/omvsadm/core
fs_type: ZFS
state: mounted
mount_opts: NOSECURITY
- name: Mount a filesystem, limiting automove to 4 devices.
zos_mount:
src: SOMEUSER.VVV.ZFS
path: /u/omvsadm/core
fs_type: ZFS
state: mounted
automove: AUTOMOVE
automove_list: I,DEV1,DEV2,DEV3,DEV9
- name: Mount a filesystem, limiting automove to all except 4 devices.
zos_mount:
src: SOMEUSER.VVV.ZFS
path: /u/omvsadm/core
fs_type: ZFS
state: mounted
automove: AUTOMOVE
automove_list: EXCLUDE,DEV4,DEV5,DEV6,DEV7
Notes¶
Note
All data sets are always assumed to be cataloged.
If an uncataloged data set needs to be fetched, it should be cataloged first.
Uncataloged data sets can be cataloged using the zos_data_set module.
Return Values¶
- path
The absolute path name onto which the file system is to be mounted.
returned: alwaystype: strsample: /u/omvsadm/core- src
The file in z/OS that is to be mounted.
returned: alwaystype: strsample: SOMEUSER.VVV.ZFS- fs_type
The type of file system that will perform the logical mount request.
returned: alwaystype: strsample: ZFS- state
The desired status of the described mount.
returned: alwaystype: strsample: mounted- persistent
Values the user provided as input.
returned: alwaystype: dict- data_store
The persistent store name where the mount was written to.
returned: alwaystype: strsample: SYS1.FILESYS(BPXPRMAA)- backup
Indicates if a backup of destinattion was configured.
returned: alwaystype: boolsample:true
- backup_name
The unique data set name for the destination backup.
returned: alwaystype: strsample: SYS1.FILESYS(PRMAABAK)- comment
The text that was used in markers around the Persistent/data_store entry.
returned: alwaystype: listsample:[ [ "u\u0027I did this because..\u0027" ] ]
- unmount_opts
Describes how the unmount is to be performed.
returned: changed and if state=unmountedtype: strsample: DRAIN- mount_opts
Options available to the mount.
returned: whenever non-Nonetype: strsample: RW,NOSECURITY- src_params
Specifies a parameter string to be passed to the file system type.
returned: whenever non-Nonetype: strsample: D(101)- tag_untagged
Indicates if tags should be written to untagged files.
returned: whenever Non-Nonetype: strsample: TEXT- tag_ccsid
CCSID for untagged files in the mounted file system.
returned: when tag_untagged is definedtype: intsample: 819- allow_uid
Whether the SETUID and SETGID mode bits on executables in this file system are considered.
returned: alwaystype: boolsample:true
- sysname
sysname specifies the particular system on which a mount should be performed.
returned: if Non-Nonetype: strsample: MVSSYS01- automove
Specifies what happens to the ownership of a file system during a shutdown, PFS termination, dead system takeover, or when file system move occurs.
returned: if Non-Nonetype: strsample: AUTOMOVE- automove_list
This specifies the list of servers to include or exclude as destinations.
returned: if Non-Nonetype: strsample: I,SERV01,SERV02,SERV03,SERV04- msg
Failure message returned by the module.
returned: failuretype: strsample: Error while gathering information- stdout
The stdout from the mount command.
returned: alwaystype: strsample: MOUNT FILESYSTEM( ‘source-dataset’ ) MOUNTPOINT( ‘/uss-path’ ) TYPE( ZFS )- stderr
The stderr from the mount command.
returned: failuretype: strsample: No such file or directory “/tmp/foo”- stdout_lines
List of strings containing individual lines from stdout.
returned: failuretype: listsample:[ "u\"MOUNT FILESYSTEM( \u0027source-dataset\u0027 ) MOUNTPOINT( \u0027/uss-path\u0027 ) TYPE( ZFS )\"" ]
- stderr_lines
List of strings containing individual lines from stderr.
returned: failuretype: listsample:[ { "u\"FileNotFoundError": "No such file or directory \u0027/tmp/foo\u0027\"" } ]
- cmd
The actual command that was run by the module.
returned: failuretype: strsample: MOUNT FILESYSTEM( ‘EXAMPLE.DATA.SET’ ) MOUNTPOINT( ‘/u/omvsadm/sample’ ) TYPE( ZFS )- rc
The return code of the mount command, if applicable.
returned: failuretype: intsample: 8