Ansible on IBM i 7.5 Automation Complete Guide
By Luca Berton · Published 2024-01-01 · Category: installation
Automate IBM i 7.5 (formerly i5/OS, OS/400) with Ansible: ibm.power_ibmi collection, PTFs, journaling, IFS, CL commands, SQL services.
IBM i 7.5 (formerly OS/400, i5/OS) is the integrated operating environment running on IBM Power servers, with built-in DB2 for i, IFS, and the unique object-based architecture. Ansible automates IBM i through the ibm.power_ibmi collection, which uses Db2 SQL services and CL commands to manage PTFs, user profiles, libraries, journaling, and IFS objects. This is the master Ansible guide for IBM i 7.5.
IBM i 7.5 release facts
| Item | Value | |---|---| | Released | 2022-05-10 | | Hardware | Power9 / Power10 / Power11 | | End of program services | 2031 (planned, with TRs) | | Key features | Db2 Mirror improvements, MFA, Open Source via RPM (yum) |
See also: Ansible AWS: Complete Guide to Cloud Automation (2026)
Ansible-core compatibility
Use ansible-core 2.18 LTS. The IBM i collection requires the 5733-OPS Open Source environment with Python (e.g., /QOpenSys/pkgs/bin/python3):
[ibmi:vars]
ansible_python_interpreter=/QOpenSys/pkgs/bin/python3
Collection:
collections:
- name: ibm.power_ibmi
version: ">=3.0.0"
Inventory
[ibmi]
ibmi01 ansible_host=10.0.6.11
ibmi02 ansible_host=10.0.6.12
[ibmi:vars]
ansible_user=ANSIBLE
ansible_password='{{ vault_ibmi_password }}'
See also: Ansible Become: Privilege Escalation with sudo, su & runas (Complete Guide)
Run a CL command
- name: Display system status
hosts: ibmi
gather_facts: false
tasks:
- name: DSPMSG
ibm.power_ibmi.ibmi_cl_command:
cmd: DSPMSG MSGQ(QSYS/QSYSOPR)
register: out
- name: Print
ansible.builtin.debug:
var: out.stdout_lines
PTF management
- name: Apply PTF group
hosts: ibmi
gather_facts: false
tasks:
- name: Load and apply PTF group
ibm.power_ibmi.ibmi_fix:
operation: load_and_apply
product: "*ALL"
fix_omit_list: []
save_file_object: PTF12345
save_file_lib: QGPL
delayed_option: "*NO"
temp_or_perm: "*PERM"
See also: Ansible check_mode: Dry Run & Test Playbooks Without Making Changes
Library/user management via SQL services
- name: Create user profile
hosts: ibmi
gather_facts: false
tasks:
- name: CRTUSRPRF
ibm.power_ibmi.ibmi_user_and_group:
operation: create
user: APPUSR1
password: "{{ vault_appusr1 }}"
user_class: "*USER"
special_authority:
- "*JOBCTL"
text: "Application user 1"
IFS file management
- name: Manage file in IFS
hosts: ibmi
gather_facts: false
tasks:
- name: Push config into IFS
ansible.builtin.copy:
src: files/app.properties
dest: /home/appusr1/app.properties
owner: APPUSR1
mode: '0600'
Journaling check
- name: Verify journals
hosts: ibmi
gather_facts: false
tasks:
- name: Query journals
ibm.power_ibmi.ibmi_sql_query:
sql: |
SELECT JOURNAL_LIBRARY, JOURNAL_NAME, JOURNAL_STATE
FROM QSYS2.JOURNAL_INFO
WHERE JOURNAL_LIBRARY NOT LIKE 'Q%';
register: journals
- name: Show
ansible.builtin.debug:
var: journals.row_changed
Best practices
• Always install Open Source 5733-OPS and Python before running playbooks; pinansible_python_interpreter.
• Use SQL services (QSYS2, SYSTOOLS) over CL commands when both exist — easier to consume programmatically.
• Apply PTFs via ibmi_fix with delayed_option: "YES" for IPL-required group PTFs, then orchestrate IPL.
• Use a dedicated service profile with limited SECADM rights for Ansible.
Conclusion
IBM i 7.5 + ibm.power_ibmi brings the green-screen world into modern Ansible pipelines. Drive PTFs, user profiles, IFS files, and Db2 SQL services through playbooks while preserving IBM i's object-level security model.
Category: installation