mount – Mounts/unmounts a filesystem or device on AIX.
Synopsis
This module mounts/unmounts a Filesystem/Device on the specified path.
Requirements
The below requirements are needed on the host that executes this module.
AIX >= 7.1 TL3
Python >= 3.6
Privileged user with authorizations: aix.fs.manage.list,aix.fs.manage.create,aix.fs.manage.change,aix.fs.manage.remove,aix.fs.manage.mount,aix.fs.manage.unmount
Parameters
- state (optional, str, mount)
Specifies the action to be performed.
mount
makes a file system available for use at a specified location (the mount point). In addition, you can use it to build other file trees made up of directory and file mounts. If no parameter is specified, it gets information for the mounted file systems. In case of NFS mount you need to export the directory from NFS server first.
umount
unmounts a previously mounted device, directory, file, or file system
show
list mounted filesytems- mount_dir (optional, str, None)
Specifies the directory path to mount/unmount.
- mount_over_dir (optional, str, None)
Directory path on which the mount_dir should be mounted.
If you specify only this directory, it looks up the associated device, directory, or file and mounts/unmounts it.
- node (optional, str, None)
Specifies the remote node holding the directory/filesystem/device to be mounted/unmounted.
- mount_all (optional, str, None)
When state=mount and mount_all=all, mounts all file systems in the /etc/filesystems file with stanzas that contain the true mount attribute.
When state=umount and mount_all=all, unmounts all mounted filesystem.
When state=umount and mount_all=remote, unmounts all remote mounted filesystems.
- force (optional, bool, False)
For remote mounted file systems, this attribute forces an unmount to free a client when the server is down and server path names cannot be resolved, or when a file system must be unmounted while it is still in use.
- alternate_fs (optional, str, None)
Mounts on a file of an alternate file system, other than the /etc/filesystems file.
- removable_fs (optional, bool, False)
Mounts a file system as a removable file system.
- read_only (optional, bool, False)
Mounts a file system as a read-only file system.
- fs_type (optional, str, None)
It specifies the name of the group to mount. It mounts/unmounts stanzas in the /etc/filesystems file that contain the type=
fs_type
attribute.- vfsname (optional, str, None)
Specifies that the file system is defined by the vfsname parameter in the /etc/vfs file.
- options (optional, str, None)
Specifies options. Options should be of the form <option-name>=<value> and multiple options should be separated only by a comma.
Notes
Note
This module runs commands that require privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand documentation.
You can refer to the IBM documentation for additional information on the commands used at https://www.ibm.com/support/knowledgecenter/ssw_aix_72/m_commands/mount.html, https://www.ibm.com/support/knowledgecenter/ssw_aix_72/u_commands/umount.html.
Examples
- name: List mounted filesystems
ibm.power_aix.mount:
state: show
- name: Mount filesystems
ibm.power_aix.mount:
state: mount
mount_dir: /mnt/tesfs
- name: Mount filesystems provided by a node
ibm.power_aix.mount:
state: mount
node: ansible-test1
mount_dir: /mnt/servnfs
mount_over_dir: /mnt/clientnfs
options: "vers=4"
- name: Mount all filesystems from the 'local' mount group
ibm.power_aix.mount:
state: mount
fs_type: local
- name: Unmount filesystem
ibm.power_aix.mount:
state: umount
mount_dir: /mnt/testfs
- name: Unmount all remote filesystems
ibm.power_aix.mount:
state: umount
mount_all: remote
force: true
- name: Unmount all remote fileystems from a node
ibm.power_aix.mount:
state: umount
node: ansible-test1
- name: Unmount all filesytems from the 'local' mount group
ibm.power_aix.mount:
state: umount
fs_type: local
Return Values
- msg (always, str, )
The execution message.
- cmd (always, str, )
The command executed.
- rc (If the command failed., int, )
The return code.
- stdout (If the command failed., str, )
The standard output.
- stderr (If the command failed., str, )
The standard error.
Status
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by community.