Power Business Continuity and Automation

Power Business Continuity and Automation

Connect, learn, and share your experiences using the business continuity and automation technologies and practices designed to ensure uninterrupted operations and rapid recovery for workloads running on IBM Power systems. 


#Power
#TechXchangeConferenceLab

 View Only

Deploying an Ansible Controller Node on AIX Using Ansible galaxy

By Vivek Pandey posted yesterday

  

Introduction: Why Automation Matters

Automation is the art of making machines do the work for us. Instead of logging into multiple servers, typing the same commands again and again, and risking human errors, we let software handle it.

  •  Increase efficiency: Reduce the time needed to complete tasks
  •  Improve consistency: Tasks are completed in consistent manner according to established standard.
  •  Accelerate response times: Respond quickly to issues or incidents without intervention.
  •  Enhance scalability: Tasks can easily be scaled to accommodate changing business needs

What is Ansible?

  •  Ansible is an open-source automation platform that allows you to configure systems, deploy applications, and orchestrate IT workflows. Key concept of ansible is agentless
  • What does “agentless” mean:
    Most automation/configuration tools (like Puppet, Chef) require you to install an agent (a small software program) on every server you want to manage. That agent talks back to a central controller.
  •  Ansible is agentless, You do not need to install any agent software on the managed servers. Ansible connects over SSH.
  •  It executes tasks remotely on managed servers using existing system tools (Python, shell, etc.).
  •  IBM Power AIX Ansible Collection is a library of pre-built Ansible modules specifically designed for AIX. It allows administrators to
  •  Manage users, storage, and performance diagnostics.
  •  Integrate AIX with enterprise automation pipelines.

Architecture diagram of Ansible

A computer network diagram showing different types of computer

AI-generated content may be incorrect.

Ansible Controller Node:

  • The central machine where Ansible is installed and playbooks are executed.
  • Connects to managed nodes via SSH.
  • Uses inventory, playbooks, and modules/collections to automate tasks.

Inventory (hosts):

  • A file that defines all managed systems (IP, hostname, groups).
  • Provides connection details for Ansible to communicate with nodes.
  • Acts as the source of truth for automation targets.

Playbooks (YAML):

  • YAML-based files containing automation tasks and workflows.
  • Define the “what to do” logic for system configuration and operations.

Modules / Collections:

  • Collections are bundles of modules, roles, and plugins.
  • Provide reusable functionality (e.g., AIX system, patching, storage).
  • Extend Ansible with IBM Power-specific capabilities.

Managed Node:

  • End systems (AIX, Linux) that receive automation tasks.
  • Do not require Ansible installation; only Python/SSH  access is needed.
  • Execute tasks remotely as instructed by the controller.

Setting Up the Controller Node

Prerequisites:

  • Ensure that Python 3 and pip are installed on the Ansible Controller Node.
  • The Controller Node should have internet connectivity to install collections via ansible-galaxy. For offline systems, dependencies can be downloaded separately and installed locally on AIX.
  • The Managed Node in this setup is AIX, which must have SSH access enabled and Python available for Ansible execution.

Step 1: Install Ansible

  1. Run the below command for MacOS as controller node
    python3 -m pip install --upgrade pip
    python3 -m pip install ansible==2.15.*

    It installs the correct Ansible version tested for AIX modules.



  2. Run the below command for AIX as controller node
    dnf install ansible


    A white background with black and white clouds

AI-generated content may be incorrect. 

Step 2: Run The Ansible galaxy for collection

Run the below command :

ansible-galaxy collection install ibm.power_aix -p <Path to collection > 

  • ansible-galaxy: command-line tool, It’s used to download, install, and manage Ansible roles and collections from Ansible Galaxy.
  • collection install: Telling ansible-galaxy to install a collection.
  • ibm.power_aix: This is the collection name
  • -p /Users/vivekpandey/Ansible_demo/aix_code_new: -p specifies the path where the collection should be installed.

3: SSH key setup 


Run the below command:

ssh-copy-id -i ~/.ssh/id_rsa.pub root@ < machine_server>

  •    ssh-copy-id : A module that installs your public key on a remote server.
  •   -i ~/.ssh/id_rsa.pub : The path to your SSH public key.
  •   < machine_server > : The remote AIX server where the key will be copied.
  •   Without this, every time Ansible connects to a managed node, it would prompt for a password
  •   With SSH key-based authentication, connections are automatic and secure.

Inventory File

Below is the inventory file structure with explanations for each line:

[usertest]

root@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[all:vars]

ansible_python_interpreter=/opt/freeware/bin/python3

- [usertest]: Group of hosts used for running modules for tests.
- [all:vars]: Variables that apply to all hosts. ansible_python_interpreter points Ansible to the correct Python path on AIX.

What is a Playbook & How it Links with Inventory

A playbook is a YAML file describing tasks to execute, while inventory lists the target hosts. When a playbook runs, Ansible matches the hosts key with groups/hosts from inventory.


Example playbook:

- name: Run entstat command with various options on AIX

  hosts: "{{ host_name }}"

  gather_facts: false

  vars:

    host_name: usertest

    user_name: aixguest

    password_val: Password

    concat_v1: 'True'

    output_dir: "/tmp/entstatdata"

  tasks:

    - name: Run entstat with default stats on ent0

      ibm.power_aix.entstat:

        device_name: ent0

        reset_stats: true

        recorded_output: "{{ output_dir }}/entstat_output.txt"

        concatenated_output: "{{ concat_v1 }}"

Run The Module

ansible-playbook -i inventory playbooks/demo_my_yml.yml -vvv

ansible-playbook : command for running the ansible modules

inventory: inventory file

playbooks/demo_my_yml.yml: playbook location

-vvv :  verbose

Output of Command:

Conclusion : 

The playbook ran 2 tasks on the managed node. Both tasks were successful and resulted in changes. The node was reachable, and no failures, skips, rescues, or ignored tasks were reported.

Capabilities of AIX Ansible:

 ibm.power_aix ansible collection modules support below area.

  •   Fix Management and NIM

            o   iFIX management

            o   Service Update Management Assistant (SUMA)

            o   Fix Level Recommendation Tool (FLRT)

            o   Generic Installation tools (geninstall)

            o   Individual Installation and updates of software

            o   NIM operations (server setup, install packages, update SP or TL, service boots).

            o   NIM backups of LPAR and VIO Clients

            o   NIM for Fix Level Recommendation Tool (FLRT)

            o   NIM for SUMA.

            o   Automated AIX migration using NIM Alternate Disk Migration (NIMADM)

            o   NIM resource manager

  • Filesystem Management

            o   Volume Group management

            o   Logical Volume management

            o   Backup for Volume Groups and Logical Volumes

            o   Filesystem Management

            o   Alternate rootvg disk management

            o   Backup of Volume

  • VIOS management via NIM

           o   Update a single or a pair VIOS servers.

           o   Backup root volume group

           o   Create/Clean an alternate rootvg

           o   Check if a pair of VIOS can be updated.

           o   Upgrade the VIOS software

  • Inventory

          o   Logical Volume Manager information

          o   Filesystem or updates information

          o   Logical Partition information

          o   Multipath I/O device information

          o   Filesystem Management

          o   Improvements in LPAR attribute, LLP, and fix information inventory collection

  •  Log Collection

          o   snap

          o   snapcore

          o   snapsplit

          o   vmstat

          o   iostat

          o   errpt

  •  Miscellaneous

          o   Logical Volume Manager information

          o   Filesystem or updates information

          o   Logical Partition information

          o   Multipath I/O device information

          o   Filesystem Management

          o   Improvements in LPAR attribute, LLP, and fix information inventory collection        

  •  Example Playbooks

          o   mktun

          o   mount

          o   installp

          o   user

          o   mpio

          o   mkfilt

          o   bosboot

          o   group

          o   tunables

          o   filesystem

          o   nim_suma

          o   logical_volume

          o   tunfile_mgmt.

          o   mktcpip

          o   inittab

Other IBM Power Collections:

  •  ibm.power_hmc :  Manage IBM Power Systems via the Hardware Management Console (HMC).
  •  ibm.power_vios :  Automate management of VIOS (Virtual I/O Server).
  •  ibm.power_vm :  Provision and manage PowerVM logical partitions (LPARs).
  •  ibm.power_linux :  Modules for Linux on Power systems (RHEL, SLES, Ubuntu).

Conclusion and Benefits of  Ansible

  • Save Time: No need to manually log in to multiple LPARs.
  • Reduce Errors: Templates and playbooks enforce consistency.
  • Standardize Operations: Same scripts work across dev, test, and production.
  • Improve Security: Enforce security baselines.
  • Scale Effortlessly: Add new servers without rewriting scripts.
  • Automation reduces manual errors and speeds up operations.
  • AIX Ansible modules bridge modern automation with enterprise UNIX.
  • The controller node setup ensures a stable, isolated environment. Inventories define your universe of hosts; playbooks define actions. Together, they form a powerful automation pipeline for IBM AIX.

Useful Links:

Ansible Galaxy: https://galaxy.ansible.com/ui/repo/published/ibm/power_aix/

GitHub: https://github.com/IBM/ansible-power-aix/tree/dev-collection/tests

Red hat automation hub: https://console.redhat.com/ansible/automation-hub/repo/published/ibm/power_aix/

 

0 comments
0 views

Permalink