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: Ie732af6a11815d4ee8efa27233d49a173372bb97
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius 2016-09-22 12:27:06 +01:00
parent 8f51eef98c
commit 62a45a48ea
4 changed files with 14 additions and 8 deletions

View File

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

View File

@ -16,14 +16,14 @@
# limitations under the License. # limitations under the License.
- include: cloudkitty_install_apt.yml - include: cloudkitty_install_apt.yml
when: static: no
- ansible_pkg_mgr == 'apt' when: ansible_pkg_mgr == 'apt'
tags: tags:
- cloudkitty-install - cloudkitty-install
- include: cloudkitty_install_yum.yml - include: cloudkitty_install_yum.yml
when: static: no
- ansible_pkg_mgr == 'yum' when: ansible_pkg_mgr == 'yum'
tags: tags:
- cloudkitty-install - cloudkitty-install

View File

@ -43,12 +43,12 @@
- include: cloudkitty_post_install.yml - include: cloudkitty_post_install.yml
- include: cloudkitty_domain_setup.yml - include: cloudkitty_domain_setup.yml
when: > static: no
inventory_hostname == groups['cloudkitty_all'][0] when: inventory_hostname == groups['cloudkitty_all'][0]
- include: cloudkitty_db_setup.yml - include: cloudkitty_db_setup.yml
when: > static: no
inventory_hostname == groups['cloudkitty_all'][0] when: inventory_hostname == groups['cloudkitty_all'][0]
- include: cloudkitty_init.yml - include: cloudkitty_init.yml

View File

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