What Ansible version does AWX 19.1.0 offer? - ansible

I am using AWX 17.1.0 which offers Ansible version 2.9.18. The older Ansible version is becoming a bit of an issue. There does not seem to be a documented way to upgrade Ansible in an existing Ansible installation. I am using btw a local docker setup.
Is this correct? That there is no documented / approved way to update Ansible?
Local docker I think is no longer an option so there is also no way to upgrade my AWX to 19.1.0.
On the website I cannot find any information on the Ansible version of AWX 19.1.0. What is Ansible version of AWX 19.1.0?

Is this correct? That there is no documented / approved way to update Ansible?
Yes. Meanwhile I have done it by building my own custom image and it worked at the time (at least for our team usage). But it is clearly not recommended. (Note that the way the images are built has drastically changed since I have done this)
Local docker I think is no longer an option so there is also no way to upgrade my AWX to 19.1.0.
I made the same interpretation mistake as you and that is actually a wrong statement. This install type just doesn't have the same visibility in the current documentation (a simple link on the install page) and has been moved to a separate page
I cannot find any information on the Ansible version of AWX 19.1.0
I didn't either briefly looking at the code, but the easiest way is probably to spawn a test install and try.

sh-4.4$ ansible --version
ansible [core 2.11.0rc2]
config file = None
configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
ansible collection location = /home/runner/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.8.3 (default, Aug 31 2020, 16:03:14) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
jinja version = 2.10.3
libyaml = True

Related

Ansible 2.9.7 on RHEL 7.9 - Upgrade plan

Ansible 2.9.7 is running on RHEL 7.9 server.
We are planning to upgrade the Ansible to latest version.
As per documentation, there are many Ansible versions released after 2.9.7 and latest one is Ansible 7 (ansible-core and ansible).
Can you advise which version would be the appropriate one to upgrade from 2.9.7 on the existing RHEL 7.9 server ? Does latest Ansible versions support RHEL 7.9 ?
Can you advise which version would be the appropriate one to upgrade from 2.9.7 on the existing RHEL 7.9 server?
This will depend on your environment and capabilities.
... just like to note that within Enterprise Packages for Linux (EPEL) a version with bug fixes is available, Ansible v2.9.27.
~/test$ yum provides ansible
...
ansible-2.9.27-1.el7.noarch : SSH-based configuration management, deployment, and task execution system
Repo : EPEL-7
Does latest Ansible versions support RHEL 7.9?
Since it is written in Python it is somehow agnostic about the underlying OS, but it will depend on the Python version installed.
If you don't plan to install another Python environment and stay with the distributed version from the OS, Python 2.7, then you are bound up to Ansible v2.11. See Ansible Community Topic Issue #54.
~/test$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
~/test$ ansible --version
ansible [core 2.11.12]
config file = /home/user/test/ansible.cfg
configured module search path = [u'/home/user/.ansible/plugins/modules', u'/home/user/.ansible/collections/ansible_collections']
ansible python module location = /home/user/.local/lib/python2.7/site-packages/ansible
ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
executable location = /home/user/.local/bin/ansible
python version = 2.7.5 (default, May 27 2022, 11:27:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
jinja version = 2.11.3
libyaml = True
If you can install another Python environment you can use higher Ansible versions.
Please take note that certain modules, Ansible Galaxy, Collections, etc. may have own requirements and dependencies.
Further Documentation Links
Installing Ansible - Prerequisites (v2.9)
Installing Ansible - Requirements (latest)
Releases and maintenance (latest)

Installing Ansible Collections on RHEL

I am trying to install Ansible collections for ServiceNow (ServiceNow collections) on RHEL 8.5 using ansible version 2.9.27, however the note on provided webpage states that
Installing collections with ansible-galaxy is only supported in
ansible 2.9+
Since Ansible v. 2.10
is not available for RHEL I cannot make an update to version 2.10 therefore I can't use ansible-galaxy. Is there any other way to install these collections? If not do you have any suggestions regarding other ways to install ansible 2.10 so I can use Ansible Tower with these collections?

Version of Python when running Ansible commands

I am using OSX.10.12.6.
I installed ansible via pip3 (in order to use it with Python3 considering Python2 is already installed on my machine by default) and downloaded the ec2.py external inventory script from Ansible github
But when running ansible commands, I get the error:
[WARNING]: * Failed to parse
~/ec2.py with script plugin: Inventory script
~/ec2.py) had an execution error: Traceback (most recent call last): File
"~/ec2.py", line 130, in <module> import boto ImportError: No module named boto
It seems to be because ansible is using Python2 instead of Python3 (I checked, I cannot import boto or ansible from Python2 but I can from Python3). Also I can run successfully the following python3 ec2.py
What is surprising is that if I run ansible --version, I get the following:
ansible 2.8.3
config file = ~/ansible.cfg
configured module search path = ['/Users/XXXX/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.5 (default, Mar 30 2018, 06:42:10) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
Is there anything I can do to "force" ansible to use Python3 instead of Python2?
PS: Note that I can get through the initial error by pip install boto on Python2, but others error pop up and would rather use Python3
FreeBSD Quarterly (Stable) Ports Branch released today 2019Q3 has Ansible 2.7.10. HEAD upgraded to Ansible 2.8.3 last Sunday! The conclusion is, FreeBSD decided not to put 2.8.3 into the STABLE branch. Probably one of the reasons is the new feature in Ansible 2.8 Python interpreter discovery. See Using FLAVORS. Hence either you downgrade to Ansible 2.7, or you proceed with fixing the HEAD (in MacOS).
It might be worth to try and set ansible_python_interpreter to Python 2.7.
(Some might argue it's rather a comment. I started there, but it's too long.)

Ansible Tower and Ansible Version

I have Ansible Tower Version of 2.4.5 and ansible version 2.1.1.
I wanted to Update Tower Version to 3.0.0 as Official Documentation says
Does anyone know if Updating Tower Version will require Ansible Version update too?
In you question you link to the latest version documentation, as per today you must upgrade the version of Ansible to 2.2 (at minimum) required to run Ansible Tower versions 3.2 and later.
In you case, you want to upgrade to the version 3.0.0:
You may refer to the Ansible Tower 3.0 Documentation.
In the Requirements documentation for version 3.0.0 it says:
While Ansible Tower depends on Ansible Playbooks and requires the
installation of the latest stable version of Ansible before installing
Tower, manual installations of Ansible are no longer required.
Beginning with Ansible Tower version 2.3, the Tower installation
program attempts to install Ansible as part of the installation
process. Previously, Tower required manual installations of the
Ansible software release package before running the Tower installation
program. Now, Tower attempts to install the latest stable Ansible
release package.
If performing a bundled tower installation, the installation program
attempts to install Ansible (and its dependencies) from the bundle for
you (refer to Using the Bundled Tower Installation Program for more
information).
If you choose to install Ansible on your own, the Tower installation
program will detect that Ansible has been installed and will not
attempt to reinstall it. Note that you must install Ansible using a
package manager like yum and that the latest stable version must be
installed for Ansible Tower to work properly.

Ansible: path to ansible.cfg

I have this known issue. So I try to fix it but I don't see where I have to create my ansible.cfg (or does it already exist)? I tried it in my homedirectory but it still did not work.
sudo vi ~/.ansible.cfg
I read a lot about /etc/ansible but on my system it isn't there.
I'm on Mac El Capitan. I've installed ansible by using pip.
ansible --version
ansible 1.9.4
configured module search path = None
From the docs:
Changes can be made and used in a configuration file which will be processed in the following order:
ANSIBLE_CONFIG (an environment variable)
ansible.cfg (in the current directory)
.ansible.cfg (in the home directory)
/etc/ansible/ansible.cfg
I'm not sure this does 100% apply to 1.9.4. Ansible is terrible in versioning their documentation. (=there only is one version and not always the version a feature was introduced or changed is mentioned)
But I am sure everything except ~/.ansible.cfg works in 1.x as I have tried that before.
So if you have created ~/.ansible.cfg and it is not being used, check if the environment var ANSIBLE_CONFIG is set or there is one file in the directory from where you call ansible. The first one found will be used. processed in the following order does not mean they will be merged in that order. First one found wins.
I read a lot about /etc/ansible but on my system it isn't there.
Yeah, that depends on how Ansible was installed. If it's not there you could just create it but if you do not need it, no need to create it. I actually deleted mine as I see no use for it.
For latest version (2.7.6) if you install via pip you wont get ansible folder in /etc.
so this is what you get when you do ansible --version
ansible --version
ansible 2.7.6
config file = None
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
But once you manually create directory under /etc as ansible and add ansible.cfg file there ansible automatically detects it. but you will have to configure the rest manually like hosts file..etc . so after this we get
ansible --version
ansible 2.7.6
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
I got the same thing when I used pip. But I think better way is either using apt or yum according to your OS.
I have centOS so following worked for me.
To get Ansible for CentOS 7, first ensure that the CentOS 7 EPEL repository is installed:
sudo yum install epel-release
Once the repository is installed, install Ansible with yum:
sudo yum install ansible
We now have all of the software required to administer our servers through Ansible.
Reference: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-centos-7

Resources