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: I634d7ba7c7d59b21cffd3cddfdc28717bbe91a86
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius 2016-09-22 13:57:52 +01:00
parent f24f266208
commit b8574291fc
5 changed files with 18 additions and 12 deletions

View File

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

View File

@ -14,12 +14,14 @@
# limitations under the License.
- include: ironic_install_apt.yml
static: no
when:
- ansible_pkg_mgr == 'apt'
vars:
apt_pkgs: "{{ ironic_conductor_distro_packages }}"
- include: ironic_install_apt.yml
static: no
when:
- ansible_pkg_mgr == 'apt'
- ironic_standalone

View File

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

View File

@ -24,6 +24,7 @@
- ironic_developer_mode | bool
- include: ironic_install_apt.yml
static: no
when:
- ansible_pkg_mgr == 'apt'
- ironic_developer_mode | bool

View File

@ -45,14 +45,14 @@
- ironic-install
- include: ironic_api_install.yml
when: >
inventory_hostname in groups['ironic_api']
static: no
when: inventory_hostname in groups['ironic_api']
tags:
- ironic-install
- include: ironic_conductor_install.yml
when: >
inventory_hostname in groups['ironic_conductor']
static: no
when: inventory_hostname in groups['ironic_conductor']
tags:
- ironic-install
@ -62,20 +62,20 @@
- ironic-config
- include: ironic_api_post_install.yml
when: >
inventory_hostname in groups['ironic_api']
static: no
when: inventory_hostname in groups['ironic_api']
tags:
- ironic-config
- include: ironic_conductor_post_install.yml
when: >
inventory_hostname in groups['ironic_conductor']
static: no
when: inventory_hostname in groups['ironic_conductor']
tags:
- ironic-config
- include: ironic_db_setup.yml
when: >
inventory_hostname == groups['ironic_conductor'][0]
static: no
when: inventory_hostname == groups['ironic_conductor'][0]
tags:
- ironic-install
@ -84,7 +84,7 @@
- ironic-install
- include: ironic_service_setup.yml
when: >
inventory_hostname == groups['ironic_api'][0]
static: no
when: inventory_hostname == groups['ironic_api'][0]
tags:
- ironic-install