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: Ib023c342e8c135e2c8aba66b1ad446304e883860
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius 2016-09-22 15:44:25 +01:00
parent 505aecf33c
commit 6d7c955aa0
2 changed files with 8 additions and 8 deletions

View File

@ -28,13 +28,13 @@
- include: tempest_install.yml
- include: tempest_resources.yml
when: >
inventory_hostname == groups[tempest_main_group][0]
static: no
when: inventory_hostname == groups[tempest_main_group][0]
# Called a second time to set facts on the other utility containers.
- include: tempest_resources.yml
when: >
inventory_hostname != groups[tempest_main_group][0]
static: no
when: inventory_hostname != groups[tempest_main_group][0]
- include: tempest_post_install.yml

View File

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