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 }}" 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 }}"