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: I27afcb8e650dc296e06d2bfaa9e084eb406fa4ef
Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
Jesse Pretorius 2016-09-22 12:18:16 +01:00
parent a23b07cdbb
commit 0b56e3dc7e
5 changed files with 17 additions and 13 deletions

View File

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

View File

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

View File

@ -57,14 +57,14 @@
- barbican-config
- include: database-setup.yml
when: >
inventory_hostname == groups['barbican_all'][0]
static: no
when: inventory_hostname == groups['barbican_all'][0]
tags:
- barbican-install
- include: service-setup.yml
when: >
inventory_hostname == groups['barbican_all'][0]
static: no
when: inventory_hostname == groups['barbican_all'][0]
tags:
- barbican-install

View File

@ -14,13 +14,13 @@
# limitations under the License.
- include: create-ssl-key.yml
when: >
inventory_hostname == groups['barbican_all'][0]
static: no
when: inventory_hostname == groups['barbican_all'][0]
- include: store-ssl-key.yml
when: >
inventory_hostname == groups['barbican_all'][0]
static: no
when: inventory_hostname == groups['barbican_all'][0]
- include: distribute-ssl-key.yml
when: >
inventory_hostname != groups['barbican_all'][0]
static: no
when: inventory_hostname != groups['barbican_all'][0]

View File

@ -14,8 +14,9 @@
# limitations under the License.
- include: self-signed-ssl.yml
when: >
barbican_ssl | bool and
(barbican_user_ssl_cert is not defined or barbican_user_ssl_key is not defined)
static: no
when:
- barbican_ssl | bool
- barbican_user_ssl_cert is not defined or barbican_user_ssl_key is not defined
- include: user-provided-ssl.yml