Original Message:
Sent: Tue October 08, 2024 05:24 AM
From: Andrey Klyachkin
Subject: nim_alt_disk_migration
Hi Henrik,
now we should define how you develop your Ansible code :-)
"Normal" case with AAP/AWX: you have your own workstation or laptop, you write the code there and then you commit the code to some Git repository, like Azure DevOps. The code is "built" and checked there and deployed to your systems or to AWX/AAP.
If you don't use your own workstation/laptop to write the code, but do it directly in some "Web UI" - there are many of them - you've lost most of the functionality you could use. Learn how to use git. You can use it quite automatically with tools like VS Code without learning whole git command line options.
You don't need ansible-galaxy in your execution environment. The file requirements.yml specifies which collections must be installed and used during the execution. It is usually read by your execution environment, but it depends what execution environment you use and how you use it.
That's why my sincere advice to you - don't rely on the infrastructure, you don't own! Either create your own infrastructure (your own execution environments) with all your dependencies or go the way I proposed to you and include the collections you need with your project.
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Tue October 08, 2024 03:44 AM
From: Henrik Morsing
Subject: nim_alt_disk_migration
Hi Andrey,
By "local workstation", do you mean execution environment? I will have to see how that is built, but I think I already checked that at the beginning of this journey.
ansible-galaxy isn't mentioned in our execution environment build document, it has a requirements.yml file that is used to pull collections from galaxy at build time. It is un-clear what reads that file or if at any point it is possible to run ansible-galaxy by hand, but I will have to ask the person who built it.
Regards,
Henrik
------------------------------
Henrik Morsing
Original Message:
Sent: Mon October 07, 2024 01:43 PM
From: Andrey Klyachkin
Subject: nim_alt_disk_migration
I never worked with Azure DevOps, but I created a new project and I see that it is quite usual Git repository with pipelines, nothing special. So it changes nothing in my answer.
You don't execute ansible-galaxy in Azure DevOps but on your local workstation where you write your code. Exactly as I wrote in the post #6 (I don't know how to post a link to the post here), do it step by step. Create a new project, execute the steps I wrote above and commit it to Azure DevOps.
If the pipeline doesn't work, post the output of the pipeline log here.
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Mon October 07, 2024 11:11 AM
From: Henrik Morsing
Subject: nim_alt_disk_migration
Hi Andrey,
> Please use ansible-galaxy to install collection even if you downloaded tarball file.
I don't know what that is, but if it is a command line tool, I doubt it can deploy to DevOps.
> Please install collections in the directory which is for collections, not for roles as per my example above
Collections or roles? I have installed the collections where collections go, the root of my DevOps deployment.
This is DevOps:
https://azure.microsoft.com/en-gb/products/devops
I can try your Ansible tool suggestion, but as we have AWX, not Ansible, it probably won't know what to do.
Regards,
Henrik
------------------------------
Henrik Morsing
Original Message:
Sent: Mon October 07, 2024 09:27 AM
From: Andrey Klyachkin
Subject: nim_alt_disk_migration
Hi Henrik,
I don't know what you mean with DevOps, but please read my post above. I didn't say a word about untar, unzip or place in roles.
- Please use ansible-galaxy to install collection even if you downloaded tarball file.
- Please install collections in the directory which is for collections, not for roles as per my example above
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Mon October 07, 2024 08:57 AM
From: Henrik Morsing
Subject: nim_alt_disk_migration
Hi Andrey,
I don't think DevOps can handle folders called *, is that really what you mean?
Again, all I have done is download the collection and it is in roles/ . I've just tried again, download 1.6.4 from here:
https://galaxy.ansible.com/ui/repo/published/ibm/power_aix/?version=1.6.4
unzip and un-tar. and nim_alt_disk_migration is under roles/ . No-where else.
Also, I have tried moving things around, it doesn't help. I could try to move internal, but I just think I'm now entering the realm of what the collections developer should be fixing, not me.
If only I could figure out where it is actually defined what "internal" refers to.
Regards,
Henrik Morsing
------------------------------
Henrik Morsing
Original Message:
Sent: Mon October 07, 2024 08:48 AM
From: Andrey Klyachkin
Subject: nim_alt_disk_migration
Hi Henrik,
as you can see from the output I posted as for me the file is in 'collections/*/plugins/modules/internal'.
From your output it is in 'roles/plugins/modules/internal' which is wrong place for one module.
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Mon October 07, 2024 08:43 AM
From: Henrik Morsing
Subject: nim_alt_disk_migration
Hi Andrey,
What do you mean "in the right place"? If its own tasks can't find it, it is surely the wrong place?
Regards,
Henrik Morsing
------------------------------
Henrik Morsing
Original Message:
Sent: Mon October 07, 2024 08:31 AM
From: Andrey Klyachkin
Subject: nim_alt_disk_migration
Hi Henrik,
if I download the version 1.6.1 which I assume you have, the file is on the right place:
$ find . -name 'nim_select_target_disk.py'./collections/ansible_collections/ibm/power_aix/plugins/modules/internal/nim_select_target_disk.py
I can suggest to remove your collections subdirectory and download all collections one more time. Or if you use private automation hub, check that you have the correct collection on your hub.
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Sat October 05, 2024 10:22 AM
From: Henrik Morsing
Subject: nim_alt_disk_migration
Hi Andrey,
That is what I have done. The structure is like it is in the collections.
Regards,
Henrik Morsing
------------------------------
Henrik Morsing
Original Message:
Sent: Fri October 04, 2024 09:59 AM
From: Andrey Klyachkin
Subject: nim_alt_disk_migration
Hi Henrik,
I don't understand why it is under roles in your structure.
- Create a subdirectory for your project:
mkdir ~/nimadmcd ~/nimadm
2. Create Ansible configuration file:
cat >ansible.cfg <<EOF[defaults]collections_paths = ./collectionsEOF
3. Install ibm.power_aix collections into subdirectory collections:
ansible-galaxy collection install ibm.power_aix -p ./collectionsORansible-galaxy collection install ibm.power_aix==1.6.1 -p ./collections
4. Write the playbook
---- name: Perform NIM alt_disk migration hosts: all vars: mountpoint: /mnt/upgrade UPDATE_LPP: "lpp_source_7300-02-00" nim_client: "{{ node }}" target_disk: disk_name: hdisk1 lpp_source: 7300-02-00-2345_lpp_source spot: spot_7300-02-00 tasks: - name: Perform 7.2 to 7.3 migration include_role: name: ibm.power_aix.nim_alt_disk_migration apply: delegate_to: "{{ nimserver }}" vars: target_disk: disk_name: hdisk1 lpp_source: 7300-02-00-2345_lpp_source spot: spot_7300-02-00 register: nimadm_results - name: "Debug: nimadm_results" debug: var=nimadm_results
5. If you are on Linux, check it with ansible-navigator.
ansible-navigator run -i inventory nimadm.yml
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Fri October 04, 2024 03:06 AM
From: Henrik Morsing
Subject: nim_alt_disk_migration
Hi Andrey,
I got a bit further yesterday. Placing the roles directory under my playbook directory picked it up. However, it now fails on finding an "internal" module/action:
ERROR! couldn't resolve module/action 'ibm.power_aix.internal.nim_select_target_disk'. This often indicates a misspelling, missing collection, or incorrect module path.
However, it is there:
I've tried putting that plugins folder in different locations but nothing helps.
Regards,
Henrik Morsing
------------------------------
Henrik Morsing
Original Message:
Sent: Thu October 03, 2024 12:07 PM
From: Andrey Klyachkin
Subject: nim_alt_disk_migration
If you use AWX or Ansible Automation Platform with Execution Environments:
- use ansible-navigator to check your playbooks and roles before deploying them into AAP
- have all resources (roles and collections) in one project directory
- create ansible.cfg specific for the project with the paths to your roles and collections
Another comment - try to write the full qualified name for your role, like ibm.power_aix.nim_alt_disk_migration instead of simply nim_alt_disk_migration. You save some time for searching through all collections and directories.
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Wed October 02, 2024 03:15 AM
From: Henrik Morsing
Subject: nim_alt_disk_migration
Good morning,
I am trying to use the above role from the ibm.power_aix collection but I just get:
ERROR! the role 'nim_alt_disk_migration' was not found in ibm.power_aix:ansible.legacy:/runner/project/ansible/playbooks/roles:/runner/requirements_roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/runner/project/ansible/playbooks
We use the collection already for standard AIX related modules, so I don't understand what the problem is. Our collection is on version 1.6.1 which definitely has this role.
.
.
.
Any ideas?
.
.
.
.
.
vars:
mountpoint: /mnt/upgrade
UPDATE_LPP: "lpp_source_7300-02-00"
nim_client: "{{ node }}"
target_disk:
disk_name: hdisk1
lpp_source: 7300-02-00-2345_lpp_source
spot: spot_7300-02-00
collections:
ibm.power_aix
tasks:
[...]
- name: Perform 7.2 to 7.3 migration
include_role:
name: nim_alt_disk_migration
apply:
delegate_to: "{{ nimserver }}"
vars:
target_disk:
disk_name: hdisk1
lpp_source: 7300-02-00-2345_lpp_source
spot: spot_7300-02-00
register: nimadm_results
- name: "Debug: nimadm_results"
debug: var=nimadm_results
.
------------------------------
Henrik Morsing
------------------------------