Upgrading very old version of Ansible on python 2.7 HELP

This is my current version of python and ansible on production:

  • ansible 2.9.3
  • python version = 2.7.5

My question is if I can upgrade python to 3.12 and then ansible to 2.16 without fucking myself over, since this is a big jump in versions?

Or should i choose another path like upgrading them incrementally?

Regards,
Dom

Hi,

I’m not knowledgeable enough about Python ecosystem to give you an appropriate answer, but I’d suggest to try the upgrade process using venvs (or virtualenvs for Python 2.7). Using python-based image containers would be another viable option.

Start with a venv for your current Python version, install Ansible into it (again, current version), then try upgrading Python in your venv, though I’m not sure you can upgrade a virtualenv (python 2.x) into a venv (python 3.x), so you might have to do it incrementally and rebuild as needed. Using containers might be easier for this purpose.

Please tell if you need assistance on any of these options !

4 Likes

Hello @ddpp123 welcome to the community!

What @ptn told you is correct, but if you need more details about how to use different python versions on your system without messing things-up, this other topic may be of help to you:

If you need further assistance just let us know :smiling_face:

Cheers!

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.