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: I508c83ee2ba774e87105c72a10be899bdc2a71b9
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius
2016-09-22 14:11:24 +01:00
parent b1a2dc2a8f
commit 2e72b72d21
3 changed files with 8 additions and 6 deletions

View File

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

View File

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

View File

@@ -52,14 +52,14 @@
- magnum-install
- include: database-setup.yml
when: >
inventory_hostname == groups['magnum_all'][0]
static: no
when: inventory_hostname == groups['magnum_all'][0]
tags:
- magnum-install
- include: service-setup.yml
when: >
inventory_hostname == groups['magnum_all'][0]
static: no
when: inventory_hostname == groups['magnum_all'][0]
tags:
- magnum-install