community.general.aix_filesystem (8.5.0) — module

Configure LVM and NFS file systems for AIX

Authors: Kairo Araujo (@kairoaraujo)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module creates, removes, mount and unmount LVM and NFS file system for AIX using C(/etc/filesystems).

For LVM file systems is possible to resize a file system.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create filesystem in a previously defined logical volume.
  community.general.aix_filesystem:
    device: testlv
    filesystem: /testfs
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Creating NFS filesystem from nfshost.
  community.general.aix_filesystem:
    device: /home/ftp
    nfs_server: nfshost
    filesystem: /home/ftp
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Creating a new file system without a previously logical volume.
  community.general.aix_filesystem:
    filesystem: /newfs
    size: 1G
    state: present
    vg: datavg
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Unmounting /testfs.
  community.general.aix_filesystem:
    filesystem: /testfs
    state: unmounted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Resizing /mksysb to +512M.
  community.general.aix_filesystem:
    filesystem: /mksysb
    size: +512M
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Resizing /mksysb to 11G.
  community.general.aix_filesystem:
    filesystem: /mksysb
    size: 11G
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Resizing /mksysb to -2G.
  community.general.aix_filesystem:
    filesystem: /mksysb
    size: -2G
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove NFS filesystem /home/ftp.
  community.general.aix_filesystem:
    filesystem: /home/ftp
    rm_mount_point: true
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove /newfs.
  community.general.aix_filesystem:
    filesystem: /newfs
    rm_mount_point: true
    state: absent

Inputs

    
vg:
    description:
    - Specifies an existing volume group (VG).
    type: str

size:
    description:
    - Specifies the file system size.
    - For already V(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.
    type: str

state:
    choices:
    - absent
    - mounted
    - present
    - unmounted
    default: present
    description:
    - Controls the file system state.
    - V(present) check if file system exists, creates or resize.
    - V(absent) removes existing file system if already V(unmounted).
    - V(mounted) checks if the file system is mounted or mount the file system.
    - V(unmounted) check if the file system is unmounted or unmount the file system.
    type: str

device:
    description:
    - 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).
    type: str

fs_type:
    default: jfs2
    description:
    - Specifies the virtual file system type.
    type: str

attributes:
    default:
    - agblksize=4096
    - isnapshot=no
    description:
    - Specifies attributes for files system separated by comma.
    elements: str
    type: list

auto_mount:
    default: true
    description:
    - File system is automatically mounted at system restart.
    type: bool

filesystem:
    description:
    - Specifies the mount point, which is the directory where the file system will be
      mounted.
    required: true
    type: str

nfs_server:
    description:
    - Specifies a Network File System (NFS) server.
    type: str

mount_group:
    description:
    - Specifies the mount group.
    type: str

permissions:
    choices:
    - ro
    - rw
    default: rw
    description:
    - Set file system permissions. V(rw) (read-write) or V(ro) (read-only).
    type: str

rm_mount_point:
    default: false
    description:
    - Removes the mount point directory when used with state V(absent).
    type: bool

account_subsystem:
    default: false
    description:
    - Specifies whether the file system is to be processed by the accounting subsystem.
    type: bool

Outputs

changed:
  description: Return changed for aix_filesystems actions as true or false.
  returned: always
  type: bool
msg:
  description: Return message regarding the action.
  returned: always
  type: str