From 27ae09856c9d2af1bfe301e5364ddbdeba72786c Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 11 Jun 2019 19:15:27 +0200 Subject: [PATCH] Install the python3 ppa also on Ubuntu 16.04. Use the role to install packages on 18.04 too. --- library/roles/python3-env/tasks/main.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/library/roles/python3-env/tasks/main.yml b/library/roles/python3-env/tasks/main.yml index 0e3f0960..efbd2113 100644 --- a/library/roles/python3-env/tasks/main.yml +++ b/library/roles/python3-env/tasks/main.yml @@ -3,6 +3,11 @@ - name: Install the python 3 ppa repository apt_repository: repo={{ py3_ppa }} update_cache=yes state=present + when: + - py3_env_install + - ansible_distribution_version is version_compare('18.04', '<') + tags: [ "python", "py3_env", "py3_env_pkgs", 'python3' ] + - name: Install the python3 deb packages apt: name={{ py3_env_dpkg }} state={{ py3_env_pkgs_state }} update_cache=yes cache_valid_time=600 @@ -16,8 +21,6 @@ pip: executable=pip{{ py3_env_version }} name={{ item.pkg }} version={{ item.version }} with_items: '{{ py3_env_versioned_pip_pkgs | default ([]) }}' - when: - - py3_env_install - - is_trusty + when: py3_env_install tags: [ "python", "py3_env", "py3_env_pkgs", 'python3' ]