W3cubDocs

/Ansible 2.9

aix_filesystem – Configure LVM and NFS file systems for AIX

New in version 2.8.

Synopsis

  • This module creates, removes, mount and unmount LVM and NFS file system for AIX using /etc/filesystems.
  • For LVM file systems is possible to resize a file system.

Parameters

Parameter Choices/Defaults Comments
account_subsystem
boolean
    Choices:
  • no
  • yes
Specifies whether the file system is to be processed by the accounting subsystem.
attributes
list
Default:
"agblksize=\u00274096\u0027,isnapshot=\u0027no\u0027"
Specifies attributes for files system separated by comma.
auto_mount
boolean
    Choices:
  • no
  • yes
File system is automatically mounted at system restart.
device
string
Logical volume (LV) device name or remote export device to create a NFS file system.
It is used to create a file system on an already existing logical volume or the exported NFS file system.
If not mentioned a new logical volume name will be created following AIX standards (LVM).
filesystem
string / required
Specifies the mount point, which is the directory where the file system will be mounted.
fs_type
string
Default:
"jfs2"
Specifies the virtual file system type.
mount_group
string
Specifies the mount group.
nfs_server
string
Specifies a Network File System (NFS) server.
permissions
string
    Choices:
  • ro
  • rw
Set file system permissions. rw (read-write) or ro (read-only).
rm_mount_point
boolean
    Choices:
  • no
  • yes
Removes the mount point directory when used with state absent.
size
string
Specifies the file system size.
For already present it will be resized.
512-byte blocks, Megabytes or Gigabytes. If the value has M specified it will be in Megabytes. If the value has G specified it will be in Gigabytes.
If no M or G the value will be 512-byte blocks.
If "+" is specified in begin of value, the value will be added.
If "-" is specified in begin of value, the value will be removed.
If "+" or "-" is not specified, the total value will be the specified.
Size will respects the LVM AIX standards.
state
string / required
    Choices:
  • absent
  • mounted
  • present
  • unmounted
Controls the file system state.
present check if file system exists, creates or resize.
absent removes existing file system if already unmounted.
mounted checks if the file system is mounted or mount the file system.
unmounted check if the file system is unmounted or unmount the file system.
vg
string
Specifies an existing volume group (VG).

Notes

Note

  • For more attributes, please check “crfs” AIX manual.

Examples

- name: Create filesystem in a previously defined logical volume.
  aix_filesystem:
    device: testlv
    filesystem: /testfs
    state: present

- name: Creating NFS filesystem from nfshost.
  aix_filesystem:
    device: /home/ftp
    nfs_server: nfshost
    filesystem: /home/ftp
    state: present

- name: Creating a new file system without a previously logical volume.
  aix_filesystem:
    filesystem: /newfs
    size: 1G
    state: present
    vg: datavg

- name: Unmounting /testfs.
  aix_filesystem:
    filesystem: /testfs
    state: unmounted

- name: Resizing /mksysb to +512M.
  aix_filesystem:
    filesystem: /mksysb
    size: +512M
    state: present

- name: Resizing /mksysb to 11G.
  aix_filesystem:
    filesystem: /mksysb
    size: 11G
    state: present

- name: Resizing /mksysb to -2G.
  aix_filesystem:
    filesystem: /mksysb
    size: -2G
    state: present

- name: Remove NFS filesystem /home/ftp.
  aix_filesystem:
    filesystem: /home/ftp
    rm_mount_point: yes
    state: absent

- name: Remove /newfs.
  aix_filesystem:
    filesystem: /newfs
    rm_mount_point: yes
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
changed
boolean
always
Return changed for aix_filesystems actions as true or false.

msg
string
always
Return message regarding the action.



Status

Authors

  • Kairo Araujo (@kairoaraujo)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/aix_filesystem_module.html