From dd968c63647c11071a7cba221eb2b2902db08434 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 6 Jul 2016 14:44:04 +0200 Subject: [PATCH] library/roles/python-env/tasks/main.yml: Update the apt cache if needed. --- python-env/tasks/main.yml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/python-env/tasks/main.yml b/python-env/tasks/main.yml index c71f7311..b60495dd 100644 --- a/python-env/tasks/main.yml +++ b/python-env/tasks/main.yml @@ -1,21 +1,20 @@ --- -- name: Install python pip - apt: name={{ item }} state={{ py_env_pkgs_state }} - with_items: py_env_basic_pkgs - tags: [ "python", "py_env" ] +- block: + + - name: Install python pip + apt: name={{ item }} state={{ py_env_pkgs_state }} update_cache=yes + with_items: '{{ py_env_basic_pkgs }}' -- name: Install python deb packages - apt: name={{ item }} state={{ py_env_pkgs_state }} - with_items: '{{ py_env_dpkg | default([]) }}' - tags: [ "python", "py_env" ] + - name: Install python deb packages + apt: name={{ item }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600 + with_items: '{{ py_env_dpkg | default([]) }}' -- name: Install deb packages needed to compile the pip modules - apt: name={{ item }} state={{ py_env_pkgs_state }} - with_items: '{{ py_pip_deps | default([]) }}' - tags: [ "python", "py_env" ] + - name: Install deb packages needed to compile the pip modules + apt: name={{ item }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600 + with_items: '{{ py_pip_deps | default([]) }}' -- name: Install a list of pip packages - pip: name={{ item }} virtualenv={{ py_env_env_base_dir }} - with_items: '{{ py_env_pip_pkgs | default ()[] }}' - tags: [ "python", "py_env" ] + - name: Install a list of pip packages + pip: name={{ item }} virtualenv={{ py_env_env_base_dir }} + with_items: '{{ py_env_pip_pkgs | default ()[] }}' + tags: [ "python", "py_env" ]