Skip to content

Commit

Permalink
Merge pull request #25 from theatro/master
Browse files Browse the repository at this point in the history
Fix support for managed nodes with py2.6 (centos6)
  • Loading branch information
bobbyrenwick authored Sep 22, 2018
2 parents f0d1f5a + 2ab66ce commit b9292ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

pip_download_dest: /tmp
pip_version:
python: python
python: "{{ ansible_python_interpreter | default( ansible_python.executable | default('python') ) }}"
pip: pip
pip_proxy: ''

pip_download_url_current: https://bootstrap.pypa.io/get-pip.py
pip_download_url_py26: https://bootstrap.pypa.io/2.6/get-pip.py
pip_download_url: "{{ ansible_python.version_info[:3]|join('.') is version_compare('2.7', '>=') | ternary( pip_download_url_current, pip_download_url_py26 ) }}"
8 changes: 6 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
register: pip_is_installed

- name: Download pip.
get_url: url=https://bootstrap.pypa.io/get-pip.py dest={{ pip_download_dest }}
get_url:
url: "{{ pip_download_url }}"
dest: "{{ pip_download_dest }}"
when: pip_is_installed.rc != 0

- name: Install pip.
Expand All @@ -19,7 +21,9 @@
when: pip_is_installed.rc != 0

- name: Delete get-pip.py.
file: state=absent path={{ pip_download_dest }}/get-pip.py
file:
state: absent
path: "{{ pip_download_dest }}/get-pip.py"
when: pip_is_installed.rc != 0

# $ pip --version
Expand Down

0 comments on commit b9292ff

Please sign in to comment.