2018-11-27 21:58:22 +00:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Install python 3 package
|
|
|
|
package:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- python36
|
|
|
|
|
2018-11-27 22:07:17 +00:00
|
|
|
- name: Check for installed pip3
|
|
|
|
stat:
|
|
|
|
path: /usr/local/bin/pip3.6
|
|
|
|
register: __python3_pip
|
|
|
|
|
2018-11-27 21:58:22 +00:00
|
|
|
- name: Setup pip3
|
|
|
|
command: /bin/python3.6 -m ensurepip
|
2018-11-27 22:09:53 +00:00
|
|
|
changed_when: not __python3_pip.stat.exists
|
2018-11-27 21:58:22 +00:00
|
|
|
|
2018-12-01 23:14:39 +00:00
|
|
|
- name: Link binaries to '{{ __python3_link_bin_path }}'
|
2018-11-27 21:58:22 +00:00
|
|
|
file:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ __python3_link_bin_path }}/{{ item.dest }}"
|
|
|
|
state: link
|
|
|
|
with_items:
|
|
|
|
- { src: /bin/python3.6, dest: python3 }
|
|
|
|
- { src: /usr/local/bin/pip3.6, dest: pip3 }
|
2018-11-27 22:08:05 +00:00
|
|
|
loop_control:
|
|
|
|
label: "{{ __python3_link_bin_path }}/{{ item.dest }}"
|
2018-11-27 21:58:22 +00:00
|
|
|
become: True
|
|
|
|
become_user: root
|