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. # limitations under the License.
- include: ironic_install_apt.yml - include: ironic_install_apt.yml
static: no
when: when:
- ansible_pkg_mgr == 'apt' - ansible_pkg_mgr == 'apt'
vars: vars:

View File

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

View File

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

View File

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

View File

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