diff --git a/defaults/main.yml b/defaults/main.yml index 5135e91..87e8f74 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,5 @@ --- +python3_packages: + - python3 + - python3-pip python3_packages_extra: [] diff --git a/tasks/setup.yml b/tasks/setup.yml index 623a798..4f5bf22 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -1,18 +1,20 @@ --- - block: - - name: Install python 3 package + - name: Install Python3 packages package: name: "{{ item }}" state: present - loop: "{{ python3_packages_extra + python3_packages | default(__python3_packages) }}" - + loop: "{{ python3_packages_extra + python3_packages }}" + - name: Link binaries to '{{ __python3_link_bin_path }}' file: src: "{{ item.src }}" dest: "{{ __python3_link_bin_path }}/{{ item.dest }}" state: link + force: yes loop: - - { src: /bin/python3.6, dest: python3 } + - { src: /usr/bin/python3.6, dest: python3 } + - { src: /usr/bin/pip3.6, dest: pip3 } loop_control: label: "{{ __python3_link_bin_path }}/{{ item.dest }}" become: True diff --git a/vars/main.yml b/vars/main.yml index e9488da..718fddd 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,5 +1,2 @@ --- -__python3_packages: - - python3 - - python3-pip __python3_link_bin_path: /usr/bin