Force Ansible to use dynamic includes

Ansible 2.1.1 introduces a regression in the way conditional
includes are handled which results in every task in the
included file being evaluated even if the condition for the
include is not met. This extends the run time significantly
for a deployment.

This patch forces all conditional includes to be dynamic.

Change-Id: Ic4b9f57ea6e0c36e8d79e6f4df26277650684c8d
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius 2016-09-22 15:34:54 +01:00
parent 0d075aad35
commit bdd4513a11
6 changed files with 24 additions and 9 deletions

View File

@ -45,6 +45,7 @@
- always
- include: nova_virt_detect.yml
static: no
when: nova_virt_type is not defined
tags:
- always
@ -56,16 +57,16 @@
- include: nova_init.yml
- include: nova_db_setup.yml
when: >
inventory_hostname == groups['nova_api_os_compute'][0]
static: no
when: inventory_hostname == groups['nova_api_os_compute'][0]
- include: nova_service_setup.yml
when: >
inventory_hostname == groups['nova_api_os_compute'][0]
static: no
when: inventory_hostname == groups['nova_api_os_compute'][0]
- include: nova_compute.yml
when: >
inventory_hostname in groups['nova_compute']
static: no
when: inventory_hostname in groups['nova_compute']
tags:
- nova-compute

View File

@ -14,12 +14,15 @@
# limitations under the License.
- include: nova_compute_kvm.yml
static: no
when: nova_virt_type == 'kvm' or nova_virt_type == 'qemu'
- include: nova_compute_powervm.yml
static: no
when: nova_virt_type == 'powervm'
- include: nova_compute_lxd.yml
static: no
when: nova_virt_type == 'lxd'
- include: nova_compute_key_populate.yml

View File

@ -56,7 +56,10 @@
- nova-pip-packages
- include: nova_console_novnc_ssl.yml
when: nova_console_user_ssl_cert is defined and nova_console_user_ssl_key is defined
static: no
when:
- nova_console_user_ssl_cert is defined
- nova_console_user_ssl_key is defined
tags:
- nova-novnc
- nova-novnc-ssl

View File

@ -14,12 +14,14 @@
# limitations under the License.
- include: nova_init_upstart.yml
static: no
when: pid1_name == "init"
tags:
- upstart-init
- nova-init
- include: nova_init_systemd.yml
static: no
when: pid1_name == "systemd"
tags:
- systemd-init

View File

@ -14,8 +14,8 @@
# limitations under the License.
- include: nova_install_apt.yml
when:
- ansible_pkg_mgr == 'apt'
static: no
when: ansible_pkg_mgr == 'apt'
- name: Create developer mode constraint file
copy:
@ -184,6 +184,7 @@
- nova-pip-packages
- include: nova_console_spice_install.yml
static: no
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "spice"
@ -191,6 +192,7 @@
- nova-spice-console
- include: nova_console_novnc_install.yml
static: no
when:
- inventory_hostname in groups['nova_console']
- nova_console_type == "novnc"

View File

@ -14,6 +14,10 @@
src: https://git.openstack.org/openstack/openstack-ansible-memcached_server
scm: git
version: master
- name: openstack_hosts
src: https://git.openstack.org/openstack/openstack-ansible-openstack_hosts
scm: git
version: master
- name: lxc_hosts
src: https://git.openstack.org/openstack/openstack-ansible-lxc_hosts
scm: git