xoxys.python3/tasks/setup.yml
2018-12-02 00:14:39 +01:00

31 lines
809 B
YAML

---
- block:
- name: Install python 3 package
package:
name: "{{ item }}"
state: present
with_items:
- python36
- name: Check for installed pip3
stat:
path: /usr/local/bin/pip3.6
register: __python3_pip
- name: Setup pip3
command: /bin/python3.6 -m ensurepip
changed_when: not __python3_pip.stat.exists
- name: Link binaries to '{{ __python3_link_bin_path }}'
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 }
loop_control:
label: "{{ __python3_link_bin_path }}/{{ item.dest }}"
become: True
become_user: root