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: I6e620e78934b70af09fe175eacf028bc0d68565c
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius 2016-09-22 14:15:38 +01:00
parent f6457c31bf
commit 370989b31f
4 changed files with 13 additions and 4 deletions

View File

@ -54,6 +54,7 @@
- always
- include: neutron_ml2_ovs_powervm.yml
static: no
when:
- neutron_os_type is defined
- neutron_os_type == 'powervm'
@ -80,11 +81,13 @@
tags:
- neutron-install
- include: calico_init.yml
static: no
when: neutron_plugin_type == 'ml2.calico'
tags:
- neutron-install
- include: neutron_db_setup.yml
static: no
when:
- neutron_services['neutron-server']['group'] in group_names
- inventory_hostname == groups[neutron_services['neutron-server']['group']][0]
@ -92,6 +95,7 @@
- neutron-install
- include: neutron_service_setup.yml
static: no
when:
- "'neutron_all' in group_names"
- inventory_hostname == groups['neutron_all'][0]
@ -99,6 +103,7 @@
- neutron-install
- include: neutron_l3_ha.yml
static: no
when:
- neutron_services['neutron-l3-agent']['group'] in group_names
- neutron_legacy_ha_tool_enabled | bool

View File

@ -14,9 +14,11 @@
# limitations under the License.
- include: neutron_init_upstart.yml
static: no
when: pid1_name == "init"
- include: neutron_init_systemd.yml
static: no
when: pid1_name == "systemd"
- name: Load service

View File

@ -14,8 +14,8 @@
# limitations under the License.
- include: neutron_install-apt.yml
when:
- ansible_pkg_mgr == 'apt'
static: no
when: ansible_pkg_mgr == 'apt'
- name: Create developer mode constraint file
copy:

View File

@ -64,6 +64,7 @@
- name: Setup Calico config
include: calico_config.yml
static: no
when: neutron_plugin_type == 'ml2.calico'
- name: Generate neutron agent only Config
@ -110,12 +111,13 @@
- name: Setup PLUMgrid config
include: plumgrid_config.yml
static: no
when: neutron_plugin_type == 'plumgrid'
- name: Setup Nuage neutron config
include: nuage_neutron_config.yml
when:
- neutron_plugin_type == 'nuage'
static: no
when: neutron_plugin_type == 'nuage'
- name: Drop metadata iptables checksum fix
copy: