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: I17c230f3178f7227b56969e2654894d4b92108e3
This commit is contained in:
parent
7f69cdd1df
commit
b9d50ce452
@ -38,7 +38,7 @@
|
||||
|
||||
- name: Install pip packages
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
name: "{{ nova_compute_pip_packages | join(' ') }}"
|
||||
state: latest
|
||||
virtualenv: "{{ nova_bin | dirname }}"
|
||||
virtualenv_site_packages: "no"
|
||||
@ -47,7 +47,6 @@
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ nova_compute_pip_packages }}"
|
||||
when:
|
||||
- nova_get_venv | failed or nova_developer_mode | bool
|
||||
tags:
|
||||
|
@ -88,7 +88,7 @@
|
||||
|
||||
- name: Install pip packages
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
name: "{{ nova_compute_powervm_pip_packages | join(' ') }}"
|
||||
state: latest
|
||||
virtualenv: "{{ nova_bin | dirname }}"
|
||||
virtualenv_site_packages: "no"
|
||||
@ -97,7 +97,6 @@
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ nova_compute_powervm_pip_packages }}"
|
||||
tags:
|
||||
- nova-install
|
||||
- nova-pip-packages
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
- name: Install pip packages
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
name: "{{ nova_novnc_pip_packages | join(' ') }}"
|
||||
state: latest
|
||||
virtualenv: "{{ nova_bin | dirname }}"
|
||||
virtualenv_site_packages: "no"
|
||||
@ -49,7 +49,6 @@
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ nova_novnc_pip_packages }}"
|
||||
when:
|
||||
- nova_get_venv | failed or nova_developer_mode | bool
|
||||
tags:
|
||||
|
@ -77,14 +77,13 @@
|
||||
|
||||
- name: Install requires pip packages
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
name: "{{ nova_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: "{{ nova_requires_pip_packages }}"
|
||||
tags:
|
||||
- nova-install
|
||||
- nova-pip-packages
|
||||
@ -172,7 +171,7 @@
|
||||
|
||||
- name: Install pip packages
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
name: "{{ nova_pip_packages | join(' ') }}"
|
||||
state: latest
|
||||
virtualenv: "{{ nova_bin | dirname }}"
|
||||
virtualenv_site_packages: "no"
|
||||
@ -181,7 +180,6 @@
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ nova_pip_packages }}"
|
||||
when:
|
||||
- nova_get_venv | failed or nova_developer_mode | bool
|
||||
notify: Restart nova services
|
||||
|
Loading…
x
Reference in New Issue
Block a user