Add tags always into external update tasks.

After bumping the Ansible version in Tripleo to 2.6, it was needed
to perform a change in the include module into include_tasks or
import_tasks, as include was getting deprecated [0]. The external
update/upgrades tasks got impacted by that change, but as they use
a loop to execute the tasks we couldn't use import_tasks.
The way include_tasks handles the tasks execution depending on the
tags differs from import_tasks (dynamic vs static) and as a consequence
when running the external upgrade run passing --tags container_image_prepare
we didn't see any tasks running. This behavior got fix in [1], which
seems to be the right way to preserve the import_tasks tags handling as
explained in [2]. But the external update tasks were missed to patch.

This patch includes the tags: always statement inside the external
update tasks and also syncs the variables content we pass into external_update_tasks
as many of those variables, which we do pass for the external_upgrade_playbook,
were missing in the external_update_playbook.

[0] - https://review.opendev.org/#/c/579844/
[1] - https://review.opendev.org/#/c/639642/1
[2] - https://github.com/ansible/ansible/issues/30882#issuecomment-380596557
Closes-Bug: #1839520
Change-Id: If7e7b4bbb3cead0887384cc543ce37e9ee5396ab
This commit is contained in:
Jose Luis Franco Arza 2019-08-09 08:37:48 +02:00 committed by Sergii Golovatiuk
parent 6b0b69f891
commit 6c675af9ba
1 changed files with 34 additions and 0 deletions

View File

@ -893,6 +893,16 @@ outputs:
params:
DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
BOOTSTRAP_SERVER_ID: {get_attr: [BootstrapServerId, value]}
ENABLE_DEBUG: {get_param: ConfigDebug}
ENABLE_PUPPET: {get_param: EnablePuppet}
DOCKER_PUPPET_DEBUG: {get_param: DockerPuppetDebug}
DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount}
DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet}
CONTAINER_CLI: {get_param: ContainerCli}
CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath}
CONTAINER_HEALTHCHECK_DISABLED: {get_param: ContainerHealthcheckDisabled}
template: |
- hosts: DEPLOY_SOURCE_HOST
name: Gather facts from undercloud
@ -948,11 +958,23 @@ outputs:
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
become: false
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
deploy_identifier: DEPLOY_IDENTIFIER
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
container_cli: CONTAINER_CLI
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
- include_tasks: external_update_steps_tasks.yaml
with_sequence: start=0 end={{external_update_steps_max-1}}
loop_control:
loop_var: step
tags: always
tags:
- external
- external_update_steps
@ -964,11 +986,23 @@ outputs:
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
become: false
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
deploy_identifier: DEPLOY_IDENTIFIER
enable_debug: ENABLE_DEBUG
enable_puppet: ENABLE_PUPPET
container_cli: CONTAINER_CLI
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
- include_tasks: external_deploy_steps_tasks.yaml
with_sequence: start=1 end={{deploy_steps_max-1}}
loop_control:
loop_var: step
tags: always
tags:
- external
- external_deploy_steps