Skip to main content

Filesystem Management Demos with Ansible on AIX

Filesystem Demos Overview

Filesystem Demos in Playbooks showcase various operations that can be performed on filesystems using Ansible modules for AIX. These demos include tasks such as creating, mounting, and unmounting filesystems, as well as modifying filesystem attributes. These playbooks serve as practical examples for users to understand and implement filesystem management tasks on AIX systems using Ansible.

Usage in playbooks/demo_mount.yml

The playbooks/demo_mount.yml playbook demonstrates how to list, mount, and unmount filesystems on AIX systems. It includes tasks for listing mounted filesystems, mounting filesystems, and unmounting filesystems.

Usage in playbooks/demo_filesystem.yml

The playbooks/demo_filesystem.yml playbook illustrates how to create a JFS2 filesystem, increase its size, and remove an NFS filesystem. It provides practical examples for managing filesystems on AIX systems using Ansible.


This playbook demonstrates how to create a JFS2 filesystem, increase its size, and remove an NFS filesystem using the ibm.power_aix.filesystem module.

---
- name: FILESYSTEM on AIX
hosts: "{{host_name}}"
gather_facts: false
vars:
host_name: all
filesystem_name: /mnt4
fs_type_v: jfs2
mount_group_v: test
permissions_v: rw
vg_v: rw

tasks:
- name: Creation of a JFS2 filesystem
ibm.power_aix.filesystem:
state: present
filesystem: "{{ filesystem_name }}"
fs_type: "{{ fs_type_v }}"
attributes: size=32768,isnapshot='no'
mount_group: "{{ mount_group_v }}"
permissions: "{{ permissions_v }}"

List Mounted Filesystems

The List mounted filesystems function is used to display all currently mounted filesystems on the AIX system. This is useful for verifying the current state of the system's mounts.


This task lists all currently mounted filesystems on the AIX system using the ibm.power_aix.mount module.

    - name: List mounted filesystems
ibm.power_aix.mount:
state: show

Mount Filesystems

The Mount filesystems function mounts a specified filesystem on the AIX system. This is essential for making a filesystem available for use.


This task mounts a specified filesystem on the AIX system using the ibm.power_aix.mount module.

    - name: Mount filesystems
ibm.power_aix.mount:
state: mount
mount_dir: "{{ mount_dir_value }}"

Creation of a JFS2 Filesystem

The Creation of a JFS2 filesystem function creates a new JFS2 filesystem on the AIX system. This is important for setting up new storage areas.


This task creates a new JFS2 filesystem on the AIX system using the ibm.power_aix.filesystem module.

    - name: Creation of a JFS2 filesystem
ibm.power_aix.filesystem:
state: present
filesystem: "{{ filesystem_name }}"
fs_type: "{{ fs_type_v }}"
attributes: size=32768,isnapshot='no'
mount_group: "{{ mount_group_v }}"
permissions: "{{ permissions_v }}"

Increase Size of a Filesystem

The Increase size of a filesystem function increases the size of an existing filesystem. This is useful for expanding storage capacity as needed.


This task increases the size of an existing filesystem on the AIX system using the ibm.power_aix.filesystem module.

    - name: Increase size of a filesystem
ibm.power_aix.filesystem:
filesystem: "{{ filesystem_name }}"
state: present
attributes: size=+5M

Remove a NFS Filesystem

The Remove a NFS filesystem function removes an existing NFS filesystem from the AIX system. This is necessary for cleaning up or decommissioning storage.


This task removes an existing NFS filesystem from the AIX system using the ibm.power_aix.filesystem module.

    - name: Remove a NFS filesystem
ibm.power_aix.filesystem:
filesystem: "{{ filesystem_name }}"
state: absent
rm_mount_point: true

 

This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human