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: I638b9e20176e0205a378704150e88d098b925c83
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius 2016-09-22 16:00:43 +01:00
parent bb37cfdd10
commit 481ad31683
1 changed files with 2 additions and 0 deletions

View File

@ -57,12 +57,14 @@
- always
- include: apt.yml
static: no
when: ansible_pkg_mgr == 'apt'
tags:
- apt
- package
- include: rpm.yml
static: no
when: ansible_pkg_mgr == 'yum' or ansible_pkg_mgr == 'dnf'
tags:
- package