I want to pip install
with --upgrade
, using Ansible.
What's the syntax?
Prerequisites for installing pip: If pip is not already have been installed on your system, then you must execute upcoming commands to install all package into your system. Install Ansible with pip package: After passing the installation of pip software , you can install Ansible.
1 – The pip package should be installed on the remote server already. You can use the Ansible apt module or similar to install this as a part of a playbook if needed. 2 – Virtualenv package should already be installed on the remote servers if you need to manage the packages in the Python virtual environment.
Updating Pip When an update for pip is available, and you run a pip command, you will see a message that says, “You are using pip version xy. a, however version xy. b is available.” You can run “pip install --upgrade pip” to install and use the new version of pip.
- name: install the package, force upgrade pip: name: <your package name> state: latest
Or with:
- name: install the package, force reinstall to the latest version pip: name: <your package name> state: forcereinstall
Eventually found the answer here: https://groups.google.com/forum/#!topic/ansible-project/a19JEpdXzck
this is the syntax:
- name: install the package, force upgrade pip: name: <your package name> extra_args: --upgrade
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With