From 7e937946005191a9362f61f0ab91b317a267bcd6 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Thu, 22 Oct 2020 12:09:25 -0500 Subject: [PATCH] Add clear facts to the start of all major playbooks This change will ensure that any and all ansible facts are cleared when starting any and all core framework interactions. By clearning the cached facts we'll ensure we're not running into legacy or otherwise outdated fact information. This change is adapted from master [0]. [0] https://github.com/openstack/tripleo-heat-templates/commit/1f9942fd755a168f8a9b75afa09e8af7027d61d4 Change-Id: I2410f86db063ef3c037baf2bc716075bda40f11c Closes-Bug: 1900836 Signed-off-by: Kevin Carter --- common/deploy-steps.j2 | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index 17a65d4c64..2360eab913 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -258,6 +258,13 @@ outputs: DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet} SELINUX_MODE: {get_param: SELinuxMode} template: | + - hosts: all + name: Clear cached facts + tasks: + - meta: clear_facts + tags: + - facts + - hosts: DEPLOY_SOURCE_HOST name: Gather facts from undercloud gather_facts: yes @@ -514,6 +521,13 @@ outputs: DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount} DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet} template: | + - hosts: all + name: Clear cached facts + tasks: + - meta: clear_facts + tags: + - facts + - always - hosts: DEPLOY_SOURCE_HOST name: Gather facts from undercloud gather_facts: yes @@ -580,6 +594,13 @@ outputs: CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath} CONTAINER_HEALTHCHECK_DISABLED: {get_param: ContainerHealthcheckDisabled} template: | + - hosts: all + name: Clear cached facts + tasks: + - meta: clear_facts + tags: + - facts + - always - hosts: DEPLOY_SOURCE_HOST name: Gather facts from undercloud gather_facts: yes @@ -665,6 +686,12 @@ outputs: DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts} DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts} template: | + - hosts: all + name: Clear cached facts + tasks: + - meta: clear_facts + tags: + - facts {%- for role in roles %} - hosts: {{role.name}} name: Gather facts from undercloud @@ -701,6 +728,14 @@ outputs: BOOTSTRAP_SERVER_ID: {get_attr: [BootstrapServerId, value]} ENABLE_DEBUG: {get_param: ConfigDebug} template: | + - hosts: all + name: Clear cached facts + tasks: + - meta: clear_facts + tags: + - facts + - always + - hosts: DEPLOY_SOURCE_HOST name: Gather facts from undercloud gather_facts: yes @@ -769,8 +804,16 @@ outputs: DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount} DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet} template: | + - hosts: all + name: Clear cached facts + tasks: + - meta: clear_facts + tags: + - facts + - hosts: DEPLOY_TARGET_HOST any_errors_fatal: yes + gather_facts: yes tasks: - include_tasks: post_upgrade_steps_tasks.yaml with_sequence: start=0 end={{post_upgrade_steps_max-1}} @@ -804,6 +847,13 @@ outputs: CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath} CONTAINER_HEALTHCHECK_DISABLED: {get_param: ContainerHealthcheckDisabled} template: | + - hosts: all + name: Clear cached facts + tasks: + - meta: clear_facts + tags: + - facts + - always - hosts: DEPLOY_SOURCE_HOST name: Gather facts from undercloud gather_facts: yes @@ -890,8 +940,16 @@ outputs: DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts} DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts} template: | + - hosts: all + name: Clear cached facts + tasks: + - meta: clear_facts + tags: + - facts + - hosts: DEPLOY_TARGET_HOST any_errors_fatal: yes + gather_facts: yes tasks: - set_fact: releases: {get_param: [FastForwardUpgradeReleases]}