From 4ab289e45b3c2718a1fe1e01e419efcb1c320358 Mon Sep 17 00:00:00 2001 From: marek-bednarski <33547693+marek-bednarski@users.noreply.github.com> Date: Fri, 11 Oct 2019 09:06:49 +0200 Subject: [PATCH 1/2] Update pip module usage for Ansible >= 2.7 --- tasks/python.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tasks/python.yml b/tasks/python.yml index c334e72..4d13c26 100644 --- a/tasks/python.yml +++ b/tasks/python.yml @@ -19,14 +19,21 @@ become: yes - name: Update tools - pip: name="setuptools virtualenv" state=latest executable=pip{{item.item}} + pip: + name: + - setuptools + - virtualenv + state: latest + executable: "pip{{item.item}}" environment: PATH: "/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin" when: item.changed with_items: "{{ python_pip_installed.results }}" - name: Install global python packages - pip: name="{{python_install|join(' ')}}" executable={{python_pkg_bin}}/pip{{item}} + pip: + name: "{{ python_install }}" + executable: "{{python_pkg_bin}}/pip{{item}}" when: python_install with_items: "{{ python_versions }}" From 82faddb4567c01661fd287502915231eb1f32b59 Mon Sep 17 00:00:00 2001 From: marek-bednarski <33547693+marek-bednarski@users.noreply.github.com> Date: Fri, 11 Oct 2019 14:36:45 +0200 Subject: [PATCH 2/2] Install python3 distutils only for newer Ubuntu --- tasks/install.deb.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/install.deb.yml b/tasks/install.deb.yml index d06d2f9..fbf947e 100644 --- a/tasks/install.deb.yml +++ b/tasks/install.deb.yml @@ -19,5 +19,5 @@ - name: Install python-distutils apt: name=python{{item}}-distutils state=present - when: item >= 3 + when: item >= 3 and ansible_distribution_major_version >= '18' with_items: "{{ python_versions }}"