Use dynamic include for conditional/tagged tasks

Ansible 2.1 tries to predict static/dynamic cases for
include. It sometimes fails to do so for tagged or conditional
include commands. This makes all included tags/tasks to be played,
but skipped anyway, even though it was asked to be omitted.

Help ansible to predict dynamic cases by explicit 'static: no'
directives put for 'when:/tags:' include commands. This speeds up
deployment a lot.

Change-Id: I3daf21e45223c5165abee74e92e1395dee5f6fe9
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2017-05-11 16:19:08 +02:00
parent a5f539c3a9
commit cb640cbe1d
2 changed files with 6 additions and 0 deletions

View File

@ -38,20 +38,24 @@
# Conditionally include a playbook for all the images specified
# in options that updates images to the latest delorean version
- include: inject_repos.yml
static: no
when: devmode|bool
# inject the gating repo generated by ansible-role-tripleo-gate
- include: inject_gating_repo.yml
static: no
when: compressed_gating_repo is defined
# Converts an overcloud-full.qcow2 into a undercloud.qcow2
- include: convert_image.yml
static: no
when: overcloud_as_undercloud|bool or baseos_as_undercloud|bool
# Update images after we have converted the overcloud-full to an
# undercloud image when using devmode. This also clones tripleo-ci
# on the undercloud image.
- include: update_image.yml
static: no
when: devmode|bool
# Inject updated overcloud and ipa images into our converted undercloud
@ -147,6 +151,7 @@
# overcloud image, to cover any extra needs.
- name: Perform extra overcloud customizations
include: customize_overcloud.yml
static: no
when: overcloud_customize_script is defined
# Perform an SELinux relabel on the undercloud image to avoid problems

View File

@ -4,6 +4,7 @@
# creating an inventory entry for our `virthost` and for creating an
# unprivileged user on that host for use by our virtual environment.
- include: provision.yml
static: no
tags:
- provision