Thanks Andrey for the update.
Original Message:
Sent: Thu April 06, 2023 04:24 AM
From: Andrey Klyachkin
Subject: Ansible setup on AIX
Hi Manoj,
I personally almost always use -y. I like to have a compatibility layer to yum. In many different documentation or presentations you still can find references to yum and it is easier for me if I have yum command as an alias to dnf. The same does Red Hat Enterprise Linux, where you have both yum and dnf commands.
Regarding updates of Ansible on AIX. I use Ansible from AIX Toolbox. It means if there is a new version of Ansible available, I can always update it using either:
dnf -y update
or Ansible itself:
- hosts: all gather_facts: no vars: ansible_python_interpreter: /opt/freeware/bin/python3 tasks: - name: update all packages dnf: name: '*' state: latest
ansible-playbook -c local -i localhost, dnf-update.yml
I hope IBM will publish a new Ansible version if there are vulnerabilities in the existing one ;-)
------------------------------
Andrey Klyachkin
https://www.power-devops.com
------------------------------
Original Message:
Sent: Thu April 06, 2023 03:31 AM
From: Manoj Kumar
Subject: Ansible setup on AIX
Hello Team,
One thing would like to know that once we run ./dnf_aixtoolbox.sh is gives below 3 option (flag) for installation. So which method would you prefer to use. We have to install across the AIX servers.
and How we can remediate any future vulnerability or update related to ansible on AIX?
Usage: dnf_aixtoolbox.sh <-d> <-y> <-n> -?
-d Install and setup dnf if yum is not installed.
yum command will not be available only dnf command can be used.
-y Installs dnf, and updates yum3 to dnf yum4 if yum3 is installed.
If no yum3 is installed then dnf and yum4 will be installed.
yum command will also be available along with dnf.
-n Install dnf where both yum and dnf can coexist if yum is installed already.
This is not a recommended option.
------------------------------
Manoj Kumar
Original Message:
Sent: Fri March 17, 2023 09:43 AM
From: minesh patel
Subject: Ansible setup on AIX
Right now there is no AIX controller node for Ansible Only Linux OS controller node. You use AIX as client of Ansible controller on Linux OS that is all. AIX Ansible controller will not work.
Original Message:
Sent: 3/16/2023 12:22:00 PM
From: Manoj Kumar
Subject: RE: Ansible setup on AIX
Thanks Andrey, it is working now. Really appreciate to working with all of you guys.
Further addition to that, in this scenario we have Linux controller node and agent are AIX and Linux both. But we use AIX controller node how we can setup the same thing. We have installing ansible with python3 on one of AIX node. We used same dnf method to install all packages. Now when we are running ansbile -m ping all command, it is giving below error.
root@server3:/# ansible -m ping all
Server1 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: root@server1: Permission denied (publickey,password,keyboard-interactive).",
"unreachable": true
}
server2 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: root@server2: Permission denied (publickey,password,keyboard-interactive).",
"unreachable": true
}
localhost | SUCCESS => {
"changed": false,
"ping": "pong"
}
server3| SUCCESS => {
"changed": false,
"ping": "pong"
}
------------------------------
Manoj Kumar
Original Message:
Sent: Tue March 14, 2023 05:39 PM
From: Andrey Klyachkin
Subject: Ansible setup on AIX
Hello Manoj,
please try:
interpreter_python = /opt/freeware/bin/python3
instead of discovered_interpreter_python=/opt/freeware/bin/python3
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Mon March 13, 2023 08:06 AM
From: Manoj Kumar
Subject: Ansible setup on AIX
Hello Andrey,
I try to update ansible.cfg with below content. But still getting same error. Can you please check whether added variable is correct or not? Anything else we need to do.
This is my ansible.cfg file, in lieu of discovered_interpreter_python I used ansible_python_interpreter but same issue. I also try to use this ansible_python_interpreter: /opt/freeware/bin/python3
cat ansible.cfg
[defaults]
inventory=/home/automation/ansible/systemfiles/inventory
log_path=/home/automation/ansible/systemfiles/ansible_logs
discovered_interpreter_python=/opt/freeware/bin/python3
forks=10
interpreter_python=auto_silent
[privilege_escalation]
become=true
become_user=root
become_method=sudo
------------------------------
Manoj Kumar
Original Message:
Sent: Tue March 07, 2023 03:11 AM
From: Andrey Klyachkin
Subject: Ansible setup on AIX
Hi Manoj,
Ansible looks for python interpreter in /usr/bin/python. Old RPM packages created a symlink in /usr/bin for python binaries. New RPM packages don't do it anymore. Because you didn't provide any error message, I can suppose that this is the reason for your failure - the failing server doesn't have /usr/bin/python.
The choices you have:
- create symlinks in /usr/bin. I wouldn't recommend unless you know what you're doing.
- add a variable ansible_python_interpreter: /opt/freeware/bin/python3 in your playbooks. This is my favourite way of solving the problem.
- add a global configuration interpreter_python = /opt/freeware/bin/python3 in /opt/freeware/etc/ansible/ansible.cfg on your Ansible controller node.
More about Python discovery in Ansible you can read here - https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html
------------------------------
Andrey Klyachkin
https://www.power-devops.com