Created
February 14, 2017 16:13
-
-
Save pjz/756ce383eb4b15f863100196b0b18f51 to your computer and use it in GitHub Desktop.
Ansible task to update pip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: get the pip version | |
command: pip --version | |
register: pip_version | |
ignore_errors: True | |
- name: fetch pip installer | |
get_url: | |
url: https://bootstrap.pypa.io/get-pip.py | |
dest: /tmp/get-pip.py | |
when: pip_version|failed | |
- name: install pip | |
command: python /tmp/get-pip.py | |
when: pip_version|failed | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got error:
PLAY [all] *********************************************************************
TASK [fetch pip installer] *****************************************************
fatal: [fake-aws]: FAILED! => {"failed": true, "msg": "The conditional check 'pip_version|failed' failed. The error was: |failed expects a dictionary\n\nThe error appears to have been in '/home/pj/work/devops/ansible/common.yaml': line 22, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: fetch pip installer\n ^ here\n"}