From d238502a035640b701263102aaa3887faf25a23b Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 18 Jul 2016 14:13:40 +0100 Subject: [PATCH] Optimise pip install tasks Unlike the Ansible apt module, the Ansible pip module does not recognise a with_items list and process all the items at once. To optimise the pip install tasks, this patch replaces the use of with_items with a join filter so that the pip install task does an install with all the packages in a list, ensuring that the execution is one action instead of many. Change-Id: I202b576df32607c23bdcd1a5d23245c0660a0758 --- tasks/galera_client_install.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasks/galera_client_install.yml b/tasks/galera_client_install.yml index 785a3d0..da1ab9d 100644 --- a/tasks/galera_client_install.yml +++ b/tasks/galera_client_install.yml @@ -27,13 +27,12 @@ - name: Install pip packages pip: - name: "{{ item }}" + name: "{{ galera_client_pip_packages | join(' ') }}" state: latest extra_args: "{{ pip_install_options|default('') }}" register: install_packages until: install_packages|success retries: 5 delay: 2 - with_items: "{{ galera_client_pip_packages }}" tags: - galera-client-pip-packages