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: I370c407fb77855fa5843d3ecbb608e94932e3447
This commit is contained in:
parent
675315289b
commit
b51eb2a511
@ -65,14 +65,13 @@
|
||||
|
||||
- name: Install requires pip packages
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
name: "{{ swift_requires_pip_packages | join(' ') }}"
|
||||
state: latest
|
||||
extra_args: "{{ pip_install_options_fact }}"
|
||||
register: install_packages
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ swift_requires_pip_packages }}"
|
||||
tags:
|
||||
- swift-install
|
||||
- swift-pip-packages
|
||||
@ -169,7 +168,7 @@
|
||||
|
||||
- name: Install pip packages
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
name: "{{ swift_pip_packages | join(' ') }}"
|
||||
state: latest
|
||||
virtualenv: "{{ swift_bin | dirname }}"
|
||||
virtualenv_site_packages: "no"
|
||||
@ -178,7 +177,6 @@
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ swift_pip_packages }}"
|
||||
when:
|
||||
- not swift_pypy_enabled | bool
|
||||
- swift_get_venv | failed or swift_developer_mode | bool
|
||||
|
@ -63,7 +63,7 @@
|
||||
|
||||
- name: Install pip packages into pypy venv
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
name: "{{ swift_pip_packages | join(' ') }}"
|
||||
state: latest
|
||||
virtualenv: "{{ swift_bin | dirname }}"
|
||||
virtualenv_site_packages: "no"
|
||||
@ -73,7 +73,6 @@
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ swift_pip_packages }}"
|
||||
notify:
|
||||
- Restart swift account services
|
||||
- Restart swift container services
|
||||
|
Loading…
x
Reference in New Issue
Block a user