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: Id87d052d6ecd0f78b67827e18dc7df1aa6804366
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius 2016-09-22 13:38:01 +01:00
parent eb213fcd43
commit 5974ede4f7
4 changed files with 12 additions and 4 deletions

View File

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

View File

@ -14,10 +14,12 @@
# limitations under the License.
- include: glance_install_apt.yml
static: no
when:
- ansible_pkg_mgr == 'apt'
- include: glance_install_yum.yml
static: no
when:
- ansible_pkg_mgr == 'yum'

View File

@ -55,14 +55,14 @@
- glance-install
- include: glance_db_setup.yml
when: >
inventory_hostname == groups['glance_all'][0]
static: no
when: inventory_hostname == groups['glance_all'][0]
tags:
- glance-install
- include: glance_service_setup.yml
when: >
inventory_hostname == groups['glance_all'][0]
static: no
when: inventory_hostname == groups['glance_all'][0]
tags:
- glance-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