bobbyrenwick / ansible-pip Goto Github PK
View Code? Open in Web Editor NEWAn ansible role that installs pip using get-pip.py and then installs any version
License: Apache License 2.0
An ansible role that installs pip using get-pip.py and then installs any version
License: Apache License 2.0
This needs to use a different URL when used on CentOS 6 with python 2.6:
https://bootstrap.pypa.io/2.6/get-pip.py
See the "Note" here: https://pip.pypa.io/en/latest/installing/#installing-with-get-pip-py
Currently, it installs pip for Python 2.x โ would be great to have the option of installing it for 3. I just hacked the source to change the binary but a variable would be good to add.
This happens on OS X and Ubuntu too, I tried to install this role using this:
dependencies:
- role: bobbyrenwick.pip
python: python
pip: pip
- role: bobbyrenwick.pip
python: python3
pip: pip3
Errors:
00:00:02.466 TASK [bobbyrenwick.pip : Upgrade to latest version of pip.] ********************
00:00:02.523 fatal: [localhost]: FAILED! => {"failed": true, "msg": "The conditional check 'pip_latest_output.stdout.find('Requirement already up-to-date') == -1' failed. The error was: error while evaluating conditional (pip_latest_output.stdout.find('Requirement already up-to-date') == -1): 'dict object' has no attribute 'stdout'"}
00:00:02.524
The code of the failing task:
- name: Upgrade to latest version of pip.
command: "{{ pip }} install -U pip"
register: pip_latest_output
become: yes
changed_when: pip_latest_output.stdout.find('Requirement already up-to-date') == -1
when: pip_version == None or pip_version == "LATEST"
Just wondering, is this repo maintained? I use this role and it works fine. But I see pull requests that definitely worth to be merged (not critical, but...) and issue that can be closed already.
What license is this under? Could you you release it under Apache 2.0?
I'd like to include it in a playbook repo that includes multiple roles, and I got push back when I tried to use an external requirement from galaxy. If I can include this there (with proper credits) that would be fantastic.
Here the module should use the proxy too if pip_proxy
is set, doen't it?
Still getting warnings about always_run
I have a couple of concerns about how this role is tested:
Python versions before 3.6 are not supported by pip
anymore, but specific versions of the get-pip.py
script are provided that make it possible to install the latest supporting version. These should be used when running ansible-pip
against an old Python version.
Additionally, for these Python releases latest
should really mean latest supporting pip
version and this role's behaviour should reflect that.
I am not sure if this is always the case, but for some versions of pip
the Upgrade to latest version of pip task returns ok
when it should return changed
. This might be caused by different versions of pip
returning different diagnostic messages.
Is this role still maintained? Is any of the maintainer willing to review and apply pull request #31, or if anyone is willing to step up, can they be added as maintainers, both on GitHub and on Galaxy?
Greetings. In an attempt to ensure pip is installed (see angstwad/docker.ubuntu#28), I did a quick playbook:
---
- hosts: staging
roles:
- bobbyrenwick.pip
- angstwad.docker_ubuntu
Several tasks are being skipped (unsure why):
``
`
TASK: [bobbyrenwick.pip | check to see if pip is already installed] ***********
changed: [staging.foobar.com]
TASK: [bobbyrenwick.pip | download pip] ***************************************
skipping: [staging.foobar.com]
TASK: [bobbyrenwick.pip | install pip] ****************************************
skipping: [staging.foobar.com]
TASK: [bobbyrenwick.pip | delete get-pip.py] **********************************
skipping: [staging.foobar.com]
TASK: [bobbyrenwick.pip | check to see if pip is installed at the correct version] ***
skipping: [staging.foobar.com]
TASK: [bobbyrenwick.pip | install required version of pip] ********************
skipping: [staging.foobar.com]
I'm then getting the following error:
TASK: [angstwad.docker_ubuntu | Install Docker-py] ****************************
failed: [staging.foobar.com] => {"cmd": "/usr/bin/pip install docker-py", "failed": true}
msg:
:stderr: Traceback (most recent call last):
File "/usr/bin/pip", line 9, in
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/lib/python2.7/dist-packages/pip/init.py", line 11, in
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in
from pip.download import path_to_url
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in
from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead
I ssh'ed into the remote instance (Ubuntu 14.04.1) and did a quick n dirty `easy_install pip`. I'm no longer getting the error message when replaying the playbook.
I hope I'm not missing the obvious - I just started with Ansible and still learning. I can provide more information if needed. Thanks!
Hi, 6 hours ago PyPA released pip10 and currently this role breaks the deployments.
If I try to instal pip10 I get such error:
TASK [bobbyrenwick.pip : Upgrade to latest version of pip.] ********************
Saturday 14 April 2018 17:03:45 +0000 (0:00:00.029) 0:01:04.226 ********
fatal: [i_019e5b99c1f1fde37]: FAILED! => {"msg": "The conditional check 'pip_latest_output.stdout.find('Requirement already up-to-date') == -1' failed. The error was: error while evaluating conditional (pip_latest_output.stdout.find('Requirement already up-to-date') == -1): 'dict object' has no attribute 'stdout'"}
If I try to install pip9.0.3 I get another error:
TASK [bobbyrenwick.pip : Install required version of pip.] *********************
Saturday 14 April 2018 17:49:25 +0000 (0:00:00.163) 0:01:01.882 ********
fatal: [i_09c5d3ce100839b1b]: FAILED! => {"changed": false, "cmd": "pip install pip==9.0.3", "msg": "[Errno 2] No such file or directory", "rc": 2}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.