We are in a vagrant environment RHEL8.9
The core python is still 3.6.8…
During installation of some core packages with yum/dnf like emacs we get python crypto errors saying that 3.6.8 is no longer supported.
In the vagrantfile
# Install Ansible
dnf -y install python3 &>/dev/null
pip3 install --upgrade pip &>/dev/null
pip3 install ansible &>/dev/null
echo "cd /vagrant" >> /home/vagrant/.bashrc
SCRIPT
ansible --version yields
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8
(default, Jan 5 2024, 08:58:17) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20)]. This feature will be removed from ansible-core in version 2.12.
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
/usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
from cryptography.exceptions import InvalidSignature
ansible [core 2.11.12]
config file = /vagrant/ansible.cfg
configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
ansible collection location = /home/vagrant/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.6.8 (default, Jan 5 2024, 08:58:17) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20)]
jinja version = 3.0.3
libyaml = True
The original run of vagrant ends up installing 3.11 python on the vagrant but the vagrant script ansible under 3.6.8 and not 3.11.
I’m not sure how to set up the script so that I can who what version of python installed by the
dnf -y install python3 &>/dev/null
so that I can install virtualenv and then create a virtualenv based on that newer python and then install ansieble in that newer python version…hope this is somewhat clear.