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: Ia72f89adc8a85e3b9b62392f24b63ede24898dc0
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius 2016-09-22 13:42:38 +01:00
parent 8fb85830d7
commit 93f96641f3
4 changed files with 13 additions and 6 deletions

View File

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

View File

@ -14,6 +14,7 @@
# limitations under the License.
- include: install-apt.yml
static: no
when:
- ansible_pkg_mgr == 'apt'

View File

@ -62,20 +62,20 @@
- heat-install
- include: heat_domain_setup.yml
when: >
inventory_hostname == groups['heat_all'][0]
static: no
when: inventory_hostname == groups['heat_all'][0]
tags:
- heat-install
- include: heat_db_setup.yml
when: >
inventory_hostname == groups['heat_all'][0]
static: no
when: inventory_hostname == groups['heat_all'][0]
tags:
- heat-install
- include: heat_service_setup.yml
when: >
inventory_hostname == groups['heat_all'][0]
static: no
when: inventory_hostname == groups['heat_all'][0]
tags:
- heat-install

View File

@ -10,6 +10,10 @@
src: https://git.openstack.org/openstack/openstack-ansible-memcached_server
scm: git
version: master
- name: openstack_hosts
src: https://git.openstack.org/openstack/openstack-ansible-openstack_hosts
scm: git
version: master
- name: lxc_hosts
src: https://git.openstack.org/openstack/openstack-ansible-lxc_hosts
scm: git