From 481ad3168385dc61c9eff0b07bc0bd6816441e3d Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 22 Sep 2016 16:00:43 +0100 Subject: [PATCH] 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 --- tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index 20b61ad7..eef41bf0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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