albertski
albertski

Reputation: 2622

Ansible is not upgrading even when it says successful

I ran the following to upgrade Ansible (I'm on 2.8.4):

s-MacBook-Pro:~ albertski$ sudo pip install ansible --upgrade
Password:
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
WARNING: The directory '/Users/albertski/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/albertski/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting ansible
  Downloading https://files.pythonhosted.org/packages/04/25/48fee5f8048360d9375e01846fcf395dda58242ed1f25a2106b6794452eb/ansible-2.8.5.tar.gz (14.4MB)
     |████████████████████████████████| 14.4MB 14.7MB/s
Requirement already satisfied, skipping upgrade: jinja2 in /Library/Python/2.7/site-packages (from ansible) (2.10)
Requirement already satisfied, skipping upgrade: PyYAML in /Library/Python/2.7/site-packages (from ansible) (3.13)
Requirement already satisfied, skipping upgrade: cryptography in /Library/Python/2.7/site-packages (from ansible) (2.4.2)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in /Library/Python/2.7/site-packages (from jinja2->ansible) (1.1.0)
Requirement already satisfied, skipping upgrade: six>=1.4.1 in /Library/Python/2.7/site-packages (from cryptography->ansible) (1.11.0)
Requirement already satisfied, skipping upgrade: cffi!=1.11.3,>=1.7 in /Library/Python/2.7/site-packages (from cryptography->ansible) (1.11.5)
Requirement already satisfied, skipping upgrade: enum34; python_version < "3" in /Library/Python/2.7/site-packages (from cryptography->ansible) (1.1.6)
Requirement already satisfied, skipping upgrade: idna>=2.1 in /Library/Python/2.7/site-packages (from cryptography->ansible) (2.7)
Requirement already satisfied, skipping upgrade: asn1crypto>=0.21.0 in /Library/Python/2.7/site-packages (from cryptography->ansible) (0.24.0)
Requirement already satisfied, skipping upgrade: ipaddress; python_version < "3" in /Library/Python/2.7/site-packages (from cryptography->ansible) (1.0.22)
Requirement already satisfied, skipping upgrade: pycparser in /Library/Python/2.7/site-packages (from cffi!=1.11.3,>=1.7->cryptography->ansible) (2.19)
Installing collected packages: ansible
  Found existing installation: ansible 2.7.13
    Uninstalling ansible-2.7.13:
      Successfully uninstalled ansible-2.7.13
  Running setup.py install for ansible ... done
Successfully installed ansible-2.8.5

It shows at the end Successfully installed ansible-2.8.5.

When I check the version it still shows 2.8.4.

Alberts-MacBook-Pro:~ albertski$ ansible --version
ansible 2.8.4
  config file = /Users/albertski/.ansible.cfg
  configured module search path = ['/Users/albertski/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible
  executable location = /Library/Frameworks/Python.framework/Versions/3.7/bin/ansible
  python version = 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28) [Clang 6.0 (clang-600.0.57)]

Edit

Tried to downgrade to 2.7.13 and I ran into the same issue:

sudo pip install ansible==2.7.13
Password:
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
WARNING: The directory '/Users/albertski/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/albertski/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting ansible==2.7.13
  Downloading https://files.pythonhosted.org/packages/71/25/90546592a692fcb8b3e6e578e743dcba19f1ecdb2ef47860dc5bf0a828aa/ansible-2.7.13.tar.gz (11.9MB)
     |████████████████████████████████| 11.9MB 7.7MB/s
Requirement already satisfied: jinja2 in /Library/Python/2.7/site-packages (from ansible==2.7.13) (2.10)
Requirement already satisfied: PyYAML in /Library/Python/2.7/site-packages (from ansible==2.7.13) (3.13)
Requirement already satisfied: paramiko in /Library/Python/2.7/site-packages (from ansible==2.7.13) (2.4.2)
Requirement already satisfied: cryptography in /Library/Python/2.7/site-packages (from ansible==2.7.13) (2.4.2)
Requirement already satisfied: setuptools in /Library/Python/2.7/site-packages (from ansible==2.7.13) (40.6.2)
Requirement already satisfied: MarkupSafe>=0.23 in /Library/Python/2.7/site-packages (from jinja2->ansible==2.7.13) (1.1.0)
Requirement already satisfied: pyasn1>=0.1.7 in /Library/Python/2.7/site-packages (from paramiko->ansible==2.7.13) (0.4.4)
Requirement already satisfied: bcrypt>=3.1.3 in /Library/Python/2.7/site-packages (from paramiko->ansible==2.7.13) (3.1.4)
Requirement already satisfied: pynacl>=1.0.1 in /Library/Python/2.7/site-packages (from paramiko->ansible==2.7.13) (1.3.0)
Requirement already satisfied: six>=1.4.1 in /Library/Python/2.7/site-packages (from cryptography->ansible==2.7.13) (1.11.0)
Requirement already satisfied: cffi!=1.11.3,>=1.7 in /Library/Python/2.7/site-packages (from cryptography->ansible==2.7.13) (1.11.5)
Requirement already satisfied: enum34; python_version < "3" in /Library/Python/2.7/site-packages (from cryptography->ansible==2.7.13) (1.1.6)
Requirement already satisfied: idna>=2.1 in /Library/Python/2.7/site-packages (from cryptography->ansible==2.7.13) (2.7)
Requirement already satisfied: asn1crypto>=0.21.0 in /Library/Python/2.7/site-packages (from cryptography->ansible==2.7.13) (0.24.0)
Requirement already satisfied: ipaddress; python_version < "3" in /Library/Python/2.7/site-packages (from cryptography->ansible==2.7.13) (1.0.22)
Requirement already satisfied: pycparser in /Library/Python/2.7/site-packages (from cffi!=1.11.3,>=1.7->cryptography->ansible==2.7.13) (2.19)
Installing collected packages: ansible
  Found existing installation: ansible 2.8.5
    Uninstalling ansible-2.8.5:
      Successfully uninstalled ansible-2.8.5
  Running setup.py install for ansible ... done
Successfully installed ansible-2.7.13
Alberts-MacBook-Pro:ansible albertski$ ansible --version
ansible 2.8.4
  config file = /Users/albertski/Sites/ansible/ansible.cfg
  configured module search path = ['/Users/albertski/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible
  executable location = /Library/Frameworks/Python.framework/Versions/3.7/bin/ansible
  python version = 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28) [Clang 6.0 (clang-600.0.57)]

Operating System: OSX Mojave

Upvotes: 0

Views: 1090

Answers (1)

Adam Miller
Adam Miller

Reputation: 927

You're installing Ansible with python2 pip and Ansible in your shell's path appears to be using python3.

Try the following: sudo pip3 install ansible --upgrade

or better yet, keep it in your user homedir

pip3 install --user ansible --upgrade

Upvotes: 1

Related Questions