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: I55d735cfc6f33dcbf4d80c97209446d3b234aaaf
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius 2016-09-22 12:10:57 +01:00
parent f5ae22d4a0
commit d1d87b8f12

View File

@ -14,12 +14,14 @@
# limitations under the License. # limitations under the License.
- include: lxc_install_apt.yml - include: lxc_install_apt.yml
static: no
when: when:
- ansible_pkg_mgr == 'apt' - ansible_pkg_mgr == 'apt'
tags: tags:
- install-apt - install-apt
- include: lxc_install_yum.yml - include: lxc_install_yum.yml
static: no
when: when:
- ansible_pkg_mgr == 'yum' - ansible_pkg_mgr == 'yum'
tags: tags: