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: Icfa54ea0e954c751759e0d750fc3d6bd25626e70
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius
2016-09-22 12:12:46 +01:00
parent 2faa7510dc
commit 635145d91f
2 changed files with 3 additions and 0 deletions

View File

@@ -43,6 +43,7 @@
- openstack_hosts-config
- include: openstack_update_hosts_file.yml
static: no
when: openstack_host_manage_hosts_file | bool
tags:
- openstack_hosts-install

View File

@@ -14,9 +14,11 @@
# limitations under the License.
- include: openstack_host_install_apt.yml
static: no
when:
- ansible_pkg_mgr == 'apt'
- include: openstack_host_install_yum.yml
static: no
when:
- ansible_pkg_mgr == 'yum'