ibm.ibm_zos_core.zos_mount (1.9.0) — module

Mount a z/OS file system.

| "added in version" 1.4.0 of ibm.ibm_zos_core"

Authors: Rich Parker (@richp405)

Install collection

Install with ansible-galaxy collection install ibm.ibm_zos_core:==1.9.0


Add to requirements.yml

  collections:
    - name: ibm.ibm_zos_core
      version: 1.9.0

Description

The module L(zos_mount,./zos_mount.html) can manage mount operations for a z/OS UNIX System Services (USS) file system data set.

The I(src) data set must be unique and a Fully Qualified Name (FQN).

The I(path) will be created if needed.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Mount a filesystem.
  zos_mount:
    src: SOMEUSER.VVV.ZFS
    path: /u/omvsadm/core
    fs_type: ZFS
    state: mounted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Unmount a filesystem.
  zos_mount:
    src: SOMEUSER.VVV.ZFS
    path: /u/omvsadm/core
    fs_type: ZFS
    state: unmounted
    unmount_opts: REMOUNT
    opts: same
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Mount a filesystem readonly.
  zos_mount:
    src: SOMEUSER.VVV.ZFS
    path: /u/omvsadm/core
    fs_type: ZFS
    state: mounted
    mount_opts: RO
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
src:
    description:
    - The name of the file system to be added to the file system hierarchy.
    - The file system I(src) must be a data set of type I(fs_type).
    - The file system I(src) data set must be cataloged.
    required: true
    type: str

path:
    description:
    - The absolute path name onto which the file system is to be mounted.
    - The I(path) is case sensitive and must be less than or equal 1023 characters long.
    required: true
    type: str

state:
    choices:
    - absent
    - mounted
    - unmounted
    - present
    - remounted
    default: mounted
    description:
    - The desired status of the described mount (choice).
    - 'If I(state=mounted) and I(src) are not in use, the module will add the file system
      entry to the parmlib member I(persistent/data_store) if not present. The I(path)
      will be updated, the device will be mounted and the module will complete successfully
      with I(changed=True).

      '
    - 'If I(state=mounted) and I(src) are in use, the module will add the file system
      entry to the parmlib member I(persistent/data_store) if not present. The I(path)
      will not be updated, the device will not be mounted and the module will complete
      successfully with I(changed=False).

      '
    - 'If I(state=unmounted) and I(src) are in use, the module will B(not) add the file
      system entry to the parmlib member I(persistent/data_store). The device will be
      unmounted and the module will complete successfully with I(changed=True).

      '
    - 'If I(state=unmounted) and I(src) are not in use, the module will B(not) add the
      file system entry to parmlib member I(persistent/data_store).The device will remain
      unchanged and the module will complete with I(changed=False).

      '
    - 'If I(state=present), the module will add the file system entry to the provided
      parmlib member I(persistent/data_store) if not present. The module will complete
      successfully with I(changed=True).

      '
    - 'If I(state=absent), the module will remove the file system entry to the provided
      parmlib member I(persistent/data_store) if present. The module will complete successfully
      with I(changed=True).

      '
    - 'If I(state=remounted), the module will B(not) add the file system entry to parmlib
      member I(persistent/data_store). The device will be unmounted and mounted, the module
      will complete successfully with I(changed=True).

      '
    required: false
    type: str

fs_type:
    choices:
    - HFS
    - ZFS
    - NFS
    - TFS
    description:
    - The type of file system that will be mounted.
    - The physical file systems data set format to perform the logical mount.
    - The I(fs_type) is required to be uppercase.
    required: true
    type: str

sysname:
    description:
    - 'For systems participating in shared file system, I(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).

      '
    - 'I(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: false
    type: str

tmp_hlq:
    description:
    - 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 C(TMPHLQ) is used.
    required: false
    type: str

automove:
    choices:
    - AUTOMOVE
    - NOAUTOMOVE
    - UNMOUNT
    default: AUTOMOVE
    description:
    - '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).

      '
    - 'I(automove=AUTOMOVE) indicates that ownership of the file system can be automatically
      moved to another system participating in a shared file system.

      '
    - 'I(automove=NOAUTOMOVE) prevents movement of the file system''s ownership in some
      situations.

      '
    - 'I(automove=UNMOUNT) allows the file system to be unmounted in some situations.

      '
    required: false
    type: str

allow_uid:
    default: true
    description:
    - '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 I(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 I(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: false
    type: bool

tag_ccsid:
    description:
    - 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
      B(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 I(tag_untagged=TEXT).
    required: false
    type: int

mount_opts:
    choices:
    - RO
    - RW
    - SAME
    - NOWAIT
    - NOSECURITY
    default: RW
    description:
    - Options available to the mount.
    - If I(mount_opts=RO) on a mounted/remount, mount is performed read-only.
    - If I(mount_opts=SAME) and (unmount_opts=REMOUNT), mount is opened in the same mode
      as previously opened.
    - If I(mount_opts=NOWAIT), mount is performed asynchronously.
    - If I(mount_opts=NOSECURITY), security checks are not enforced for files in this
      file system.
    required: false
    type: str

persistent:
    description:
    - Add or remove mount command entries to provided I(data_store)
    required: false
    suboptions:
      backup:
        default: false
        description:
        - Creates a backup file or backup data set for I(data_store), including the timestamp
          information to ensure that you retrieve the original parameters defined in I(data_store).
        - I(backup_name) can be used to specify a backup file name if I(backup=true).
        - The backup file name will be returned on either success or failure of module
          execution such that data can be retrieved.
        required: false
        type: bool
      backup_name:
        description:
        - Specify the USS file name or data set name for the destination backup.
        - If the source I(data_store) is a USS file or path, the I(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 I(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, C(/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: false
        type: str
      comment:
        description:
        - If provided, this is used as a comment that surrounds the command in the I(persistent/data_store)
        - Comments are used to encapsulate the I(persistent/data_store) entry such that
          they can easily be understood and located.
        elements: str
        required: false
        type: list
      data_store:
        description:
        - The data set name used for persisting a mount command. This is usually BPXPRMxx
          or a copy.
        required: true
        type: str
    type: dict

src_params:
    description:
    - 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: false
    type: str

tag_untagged:
    choices:
    - TEXT
    - NOTEXT
    description:
    - If present, tags get written to any untagged file.
    - When the file system is unmounted, the tags are lost.
    - If I(tag_untagged=NOTEXT) none of the untagged files in the file system are automatically
      converted during file reading and writing.
    - If I(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: false
    type: str

unmount_opts:
    choices:
    - DRAIN
    - FORCE
    - IMMEDIATE
    - NORMAL
    - REMOUNT
    - RESET
    default: NORMAL
    description:
    - Describes how the unmount will be performed.
    - For more on coded character set identifiers, review the IBM documentation topic
      B(UNMOUNT - Remove a file system from the file hierarchy).
    required: false
    type: str

automove_list:
    description:
    - '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: false
    type: str

Outputs

allow_uid:
  description: Whether the SETUID and SETGID mode bits on executables in this file
    system are considered.
  returned: always
  sample: true
  type: bool
automove:
  description:
  - '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-None
  sample: AUTOMOVE
  type: str
automove_list:
  description: This specifies the list of servers to include or exclude as destinations.
  returned: if Non-None
  sample: I,SERV01,SERV02,SERV03,SERV04
  type: str
cmd:
  description: The actual command that was run by the module.
  returned: failure
  sample: MOUNT FILESYSTEM( 'EXAMPLE.DATA.SET' ) MOUNTPOINT( '/u/omvsadm/sample' )
    TYPE( ZFS )
  type: str
fs_type:
  description: The type of file system that will perform the logical mount request.
  returned: always
  sample: ZFS
  type: str
mount_opts:
  description: Options available to the mount.
  returned: whenever non-None
  sample: RW,NOSECURITY
  type: str
msg:
  description: Failure message returned by the module.
  returned: failure
  sample: Error while gathering information
  type: str
path:
  description: The absolute path name onto which the file system is to be mounted.
  returned: always
  sample: /u/omvsadm/core
  type: str
persistent:
  contains:
    backup:
      description: Indicates if a backup of destinattion was configured.
      returned: always
      sample: true
      type: bool
    backup_name:
      description: The unique data set name for the destination backup.
      returned: always
      sample: SYS1.FILESYS(PRMAABAK)
      type: str
    comment:
      description: The text that was used in markers around the I(Persistent/data_store)
        entry.
      returned: always
      sample:
      - - u'I did this because..'
      type: list
    data_store:
      description: The persistent store name where the mount was written to.
      returned: always
      sample: SYS1.FILESYS(BPXPRMAA)
      type: str
  description: Values the user provided as input.
  returned: always
  type: dict
rc:
  description: The return code of the mount command, if applicable.
  returned: failure
  sample: 8
  type: int
src:
  description: The file in z/OS that is to be mounted.
  returned: always
  sample: SOMEUSER.VVV.ZFS
  type: str
src_params:
  description: Specifies a parameter string to be passed to the file system type.
  returned: whenever non-None
  sample: D(101)
  type: str
state:
  description: The desired status of the described mount.
  returned: always
  sample: mounted
  type: str
stderr:
  description: The stderr from the mount command.
  returned: failure
  sample: No such file or directory "/tmp/foo"
  type: str
stderr_lines:
  description: List of strings containing individual lines from stderr.
  returned: failure
  sample:
  - u"FileNotFoundError: No such file or directory '/tmp/foo'"
  type: list
stdout:
  description: The stdout from the mount command.
  returned: always
  sample: MOUNT FILESYSTEM( 'source-dataset' ) MOUNTPOINT( '/uss-path' ) TYPE( ZFS
    )
  type: str
stdout_lines:
  description: List of strings containing individual lines from stdout.
  returned: failure
  sample:
  - u"MOUNT FILESYSTEM( 'source-dataset' ) MOUNTPOINT( '/uss-path' ) TYPE( ZFS )"
  type: list
sysname:
  description: I(sysname) specifies the particular system on which a mount should
    be performed.
  returned: if Non-None
  sample: MVSSYS01
  type: str
tag_ccsid:
  description: CCSID for untagged files in the mounted file system.
  returned: when tag_untagged is defined
  sample: 819
  type: int
tag_untagged:
  description: Indicates if tags should be written to untagged files.
  returned: whenever Non-None
  sample: TEXT
  type: str
unmount_opts:
  description: Describes how the unmount is to be performed.
  returned: changed and if state=unmounted
  sample: DRAIN
  type: str

See also