Skip to content

Instantly share code, notes, and snippets.

@pjz
Created February 14, 2017 16:13
Show Gist options
  • Save pjz/756ce383eb4b15f863100196b0b18f51 to your computer and use it in GitHub Desktop.
Save pjz/756ce383eb4b15f863100196b0b18f51 to your computer and use it in GitHub Desktop.
Ansible task to update pip
- 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
@pjz
Copy link
Author

pjz commented Feb 14, 2017

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"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment