--- ## # get latest pip (had problems with version from apt-get, specifically ## # "pip install pyopenssl" did not install the dependency "cryptography") ## # http://stackoverflow.com/questions/34587473/what-is-get-pip-py-checksum-where-can-i-get-it-for-sure ## - name: install setuptools for python 2 and 3 ## become: true ## apt: name={{item}} state=present ## with_items: ## - python-setuptools ## - python3-setuptools ## - name: download pip-8.1.2.tar.gz ## get_url: ## url: https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/pip-8.1.2.tar.gz ## dest: /tmp ## checksum: sha1:1c13c247967ec5bee6de5fd104c5d78ba30951c7 ## - name: extract pip-8.1.2.tar.gz ## unarchive: src=/tmp/pip-8.1.2.tar.gz dest=/tmp copy=no ## - name: run "python3 setup.py install" in /tmp/pip-8.1.2 ## command: python3 setup.py install chdir=/tmp/pip-8.1.2 ## creates=/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/__init__.py ## become: true - command: id {{user}} register: id_user ignore_errors: true changed_when: false - name: ensure service user {{user}} exists user: name={{user}} system=yes createhome=no home=/nonexistent shell=/usr/sbin/nologin become: true when: id_user|failed