Performance: replace unconditional include_tasks with import_tasks

Including tasks has a performance penalty when compared with importing
tasks. If the include has a condition associated with it, then the
overhead of the include may be lower than the overhead of skipping all
imported tasks. For unconditionally included tasks, switching to
import_tasks provides a clear benefit.

Benchmarking of include vs. import is available at [1].

This change switches from include_tasks to import_tasks where there is
no condition applied to the include.

[1] https://github.com/stackhpc/ansible-scaling/blob/master/doc/include-and-import.md#task-include-and-import

Partially-Implements: blueprint performance-improvements

Change-Id: Ia45af4a198e422773d9f009c7f7b2e32ce9e3b97
This commit is contained in:
Mark Goddard 2020-06-29 15:06:53 +01:00 committed by Radosław Piliszek
parent 48da350000
commit b685ac44e0
253 changed files with 350 additions and 350 deletions

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['aodh-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when: aodh_dev_mode | bool

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['barbican-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when: barbican_dev_mode | bool

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,9 +1,9 @@
---
- include_tasks: pre-install.yml
- import_tasks: pre-install.yml
- include_tasks: install.yml
- import_tasks: install.yml
- include_tasks: post-install.yml
- import_tasks: post-install.yml
- include_tasks: configure-containerd-for-zun.yml
when: containerd_configure_for_zun|bool and

View File

@ -1,6 +1,6 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: start.yml
- import_tasks: start.yml
- include_tasks: bootstrap.yml
- import_tasks: bootstrap.yml

View File

@ -10,7 +10,7 @@
with_items:
- { name: bifrost-deploy, group: bifrost-deploy }
- include_tasks: config.yml
- import_tasks: config.yml
- name: Check the configs
become: true

View File

@ -1,5 +1,5 @@
---
# Stop the container prior to redeploying it.
- include_tasks: stop.yml
- import_tasks: stop.yml
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -58,4 +58,4 @@
run_once: True
delegate_to: "{{ groups['blazar-api'][0] }}"
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['blazar-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when: blazar_dev_mode | bool

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,3 +1,3 @@
---
# TODO(Jeffrey4l): fix idempotent
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['ceilometer']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when: ceilometer_dev_mode | bool

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['cinder-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when: cinder_dev_mode | bool
@ -13,4 +13,4 @@
- name: Flush handlers
meta: flush_handlers
- include_tasks: check.yml
- import_tasks: check.yml

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -4,9 +4,9 @@
- include_tasks: config.yml
when: inventory_hostname == groups["cinder-api"][0]
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -43,4 +43,4 @@
database_name: "{{ cloudkitty_influxdb_name }}"
when: cloudkitty_storage_backend == 'influxdb'
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['cloudkitty-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when: cloudkitty_dev_mode | bool

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap.yml
- import_tasks: bootstrap.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['cyborg-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap.yml
when: inventory_hostname in groups['cyborg-api']

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -40,4 +40,4 @@
- not use_preconfigured_databases | bool
no_log: true
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['designate-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when: designate_dev_mode | bool

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,9 +1,9 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers
- include_tasks: update_pools.yml
- import_tasks: update_pools.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config-host.yml
- import_tasks: config-host.yml
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -50,9 +50,9 @@
volumes: "{{ service.volumes }}"
when: inventory_hostname in groups[service.group]
- include_tasks: config-host.yml
- import_tasks: config-host.yml
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['freezer-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when: freezer_dev_mode | bool

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -1,7 +1,7 @@
---
- import_tasks: register.yml
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when:
@ -12,4 +12,4 @@
- name: Flush handlers
meta: flush_handlers
- include_tasks: check.yml
- import_tasks: check.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['gnocchi-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap.yml
when: inventory_hostname in groups['gnocchi-api']

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,9 +1,9 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap.yml
- import_tasks: bootstrap.yml
- name: Flush handlers
meta: flush_handlers
- include_tasks: post_config.yml
- import_tasks: post_config.yml

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -12,7 +12,7 @@
when: inventory_hostname in groups['grafana']
register: grafana_differs
- include_tasks: config.yml
- import_tasks: config.yml
# NOTE(dszumski): We don't want old Grafana instances running after
# a new instance has updated the DB schema. Since the first instance

View File

@ -1,7 +1,7 @@
---
- include_tasks: config-host.yml
- import_tasks: config-host.yml
- include_tasks: config.yml
- import_tasks: config.yml
# NOTE(yoctozepto): haproxy role handlers should not be flushed early.
# site.yml handles all haproxy things in a dedicated play.

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config-host.yml
- import_tasks: config-host.yml
- include_tasks: config.yml
- import_tasks: config.yml
- name: Stopping all slave keepalived containers
vars:

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['heat-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when:

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
# NOTE(priteau): Remove this task in V cycle.
- name: Remove heat-engine environment file

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when:

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when:

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -51,7 +51,7 @@
- not use_preconfigured_databases | bool
- inventory_hostname in groups[item.group]
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Running Ironic-PXE bootstrap container
vars:

View File

@ -4,9 +4,9 @@
(inventory_hostname in groups['ironic-api'] or
inventory_hostname in groups['ironic-inspector'])
- include_tasks: config-host.yml
- import_tasks: config-host.yml
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when: ironic_dev_mode | bool

View File

@ -1,9 +1,9 @@
---
- include_tasks: config-host.yml
- import_tasks: config-host.yml
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,12 +1,12 @@
---
- include_tasks: config-host.yml
- import_tasks: config-host.yml
# Pin release version
- include_tasks: config.yml
- import_tasks: config.yml
vars:
pin_release_version: "{{ openstack_previous_release_name }}"
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
# TODO(donghm): Flush_handlers to restart ironic services
# should be run in serial nodes to decrease downtime. Update when
@ -17,7 +17,7 @@
meta: flush_handlers
# Unpin version
- include_tasks: config.yml
- import_tasks: config.yml
# Restart ironic services with unpinned release version
- name: Flush handlers

View File

@ -1,7 +1,7 @@
---
- include_tasks: config-host.yml
- import_tasks: config-host.yml
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -2,7 +2,7 @@
- include_tasks: register.yml
when: inventory_hostname in groups['karbor-api']
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap.yml
when: inventory_hostname in groups['karbor-api']

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,7 +1,7 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml
- name: Flush handlers
meta: flush_handlers

View File

@ -33,4 +33,4 @@
when:
- not use_preconfigured_databases | bool
- include_tasks: bootstrap_service.yml
- import_tasks: bootstrap_service.yml

View File

@ -1,11 +1,11 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- include_tasks: clone.yml
when:
- keystone_dev_mode | bool
- include_tasks: bootstrap.yml
- import_tasks: bootstrap.yml
- name: Flush handlers
meta: flush_handlers
@ -14,6 +14,6 @@
when:
- keystone_token_provider == 'fernet'
- include_tasks: register.yml
- import_tasks: register.yml
- include_tasks: check.yml
- import_tasks: check.yml

View File

@ -1,2 +1,2 @@
---
- include_tasks: deploy.yml
- import_tasks: deploy.yml

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Enable log_bin_trust_function_creators function
become: true

View File

@ -1,5 +1,5 @@
---
- include_tasks: config.yml
- import_tasks: config.yml
- name: Flush handlers
meta: flush_handlers

Some files were not shown because too many files have changed in this diff Show More