Thanks Andrey, It's working now. I always really appreciate to working with you. Always found my query answer.
Original Message:
Sent: Mon December 18, 2023 06:35 AM
From: Andrey Klyachkin
Subject: Not able to run clone playbook from ansible automation platform
Hi Manoj,
if you use "manual" SCM type in AAP, change to the directory with your playbooks, in your case it is /var/lib/awx/projects/playbooks
cd /var/lib/awx/projects/playbooks
Create ansible.cfg file with the following content:
[defaults]collections_paths=./collections
If you already have ansible.cfg, just add the path for collections.
Create a subdirectory for collections:
mkdir collections
Add the collections you need to the subdirectory:
ansible-galaxy collection install ibm.power_aix -p collections
Make sure that everything is owned by user awx:
sudo chown -R awx .
Start the job in AAP. It should work.
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Mon December 18, 2023 04:30 AM
From: Manoj Kumar
Subject: Not able to run clone playbook from ansible automation platform
Hello Andrey,
Please find the below snippet.

------------------------------
Manoj Kumar
Original Message:
Sent: Fri December 15, 2023 08:47 AM
From: Andrey Klyachkin
Subject: Not able to run clone playbook from ansible automation platform
HI Manoj,
can you please make a screenshot of your "patch project" definition?
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Fri December 15, 2023 07:18 AM
From: Manoj Kumar
Subject: Not able to run clone playbook from ansible automation platform
Thanks Andrey for the update.
We tried to execute the playbook as you mentioned but still getting the error message. It seems we are missing something.
Later we will try to create separate execution environment, we will go through that video. But first we wanted to execute the playbook without execution environment as you mentioned in first step.
[root@ collections]# pwd
/var/lib/awx/projects/collections
[root@ collections]# cat requirements.yml
---
collections:
- name: ibm.power_aix
screenshot from aap:

Error after playbook execution
ansible-playbook [core 2.15.4]
2
config file = /etc/ansible/ansible.cfg
3
configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
4
ansible python module location = /usr/lib/python3.9/site-packages/ansible
5
ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
6
executable location = /usr/bin/ansible-playbook
7
python version = 3.9.16 (main, May 31 2023, 12:21:58) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] (/usr/bin/python3.9)
10
Using /etc/ansible/ansible.cfg as config file
11
host_list declined parsing /runner/inventory/hosts as it did not pass its verify_file() method
12
Parsed /runner/inventory/hosts inventory source with script plugin
13
ERROR! couldn't resolve module/action 'ibm.power_aix.alt_disk'. This often indicates a misspelling, missing collection, or incorrect module path.
15
The error appears to be in '/runner/project/alt_disk_copy.yml': line 20, column 5, but may
16
be elsewhere in the file depending on the exact syntax problem.
18
The offending line appears to be:
20
# Create sysalt on existing altinst_rootvg or old_rootvg disk
------------------------------
Manoj Kumar
Original Message:
Sent: Fri December 15, 2023 06:16 AM
From: Andrey Klyachkin
Subject: Not able to run clone playbook from ansible automation platform
Hi Manoj,
thank you for your answers.
What you've shared are locally installed collections. In AAP2 execution environments are used to execute your playbooks. If you use default execution environment, it doesn't contain any IBM collection and has no idea that you need one.
You must create a subfolder "collections" in your project and add requirement.yml file there, like:
---collections: - name: ibm.power_aix - name: enfence.powerha_aix
Then it will download the collection from Ansible Galaxy before executing the playbook.
Or you can create your own execution environment with the collections you need. It takes more time but I think it is better from the development perspective. I did the video a year ago about building execution environments for ibm.power_aix collection - https://youtu.be/HO_Scxhc6Pg
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Fri December 15, 2023 05:46 AM
From: Manoj Kumar
Subject: Not able to run clone playbook from ansible automation platform
Hello Andrey,
Please find the response on below.
do you use Ansible Automation Platform 2?
Yes, we are using aap 2. Please find the output below.
ansible --version
ansible [core 2.15.4]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.9/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.9.16 (main, May 31 2023, 12:21:58) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] (/usr/bin/python3.9)
jinja version = 3.1.2
libyaml = True
which execution environment do you use to execute your playbook?
We use default execution environment. Can we create new execution environment and how we can do that for IBM AIX.
does the execution environment contain ibm.power_aix collection?
Please find the collection from controller node.
ansible-galaxy collection list
# /root/.ansible/collections/ansible_collections
Collection Version
--------------- -------
ibm.power_aix 1.7.2
servicenow.itsm 2.3.0
do you have requirements.yml file with the list of the required collections in your project?
Collection list is shared in above command.
Please check all response above and let us know if we are missing something here. Normal AIX playbook where we don't use IBM power collection we can execute from ansible automation platform.
------------------------------
Manoj Kumar
Original Message:
Sent: Fri December 15, 2023 05:03 AM
From: Andrey Klyachkin
Subject: Not able to run clone playbook from ansible automation platform
Hi Manoj,
do you use Ansible Automation Platform 2?
which execution environment do you use to execute your playbook?
does the execution environment contain ibm.power_aix collection?
do you have requirements.yml file with the list of the required collections in your project?
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Thu December 14, 2023 08:37 AM
From: Manoj Kumar
Subject: Not able to run clone playbook from ansible automation platform
Hello Team,
We are not able to run alt_clone play book from ansible automation platform. We are getting following error. It seems to be related to IBM power collection package not able to locate. Would you please help ?
ansible-playbook [core 2.15.4]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.9/site-packages/ansible
ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible-playbook
python version = 3.9.16 (main, May 31 2023, 12:21:58) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] (/usr/bin/python3.9)
jinja version = 3.1.2
libyaml = True
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /runner/inventory/hosts as it did not pass its verify_file() method
Parsed /runner/inventory/hosts inventory source with script plugin
ERROR! couldn't resolve module/action 'ibm.power_aix.alt_disk'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/runner/project/alt_disk_copy.yml': line 22, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
# Create sysalt on existing altinst_rootvg or old_rootvg disk
- name: Create sysalt on existing altinst_rootvg or old_rootvg disk
^ here
Playbook content:
---
- name: Alt Disk copy in AIX
hosts: all
vars:
ansible_python_interpreter: /opt/freeware/bin/python3
strategy: linear
gather_facts: false
# Tasks
tasks:
# Retrieve disk list
- name: Retrieve disk list with lspv command
ansible.builtin.shell:
cmd: 'lspv | grep -E "_rootvg"|grep -v grep'
register: pv_list
# Create sysalt on existing altinst_rootvg or old_rootvg disk
- name: Create sysalt on existing altinst_rootvg or old_rootvg disk
ibm.power_aix.alt_disk:
action: copy
force: True
allow_old_rootvg: True
targets: "{{ lspv_disk[0] }}"
register: sysalt_run
when: '"_rootvg" in lspv_disk[2]'
vars:
lspv_disk: "{{ item|split() }}"
with_list: "{{ pv_list.stdout_lines }}"
# Fail if no sysalt processed
- name: Fail if no sysalt processed
ansible.builtin.fail:
msg: No sysalt have been processed
when: sysalt_run.changed == false
------------------------------
Manoj Kumar
------------------------------