From a1443bb8271deb8b134c5cd6660ab85cf2f5ed39 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 9 Jun 2020 12:32:37 -0400 Subject: [PATCH] Relax facts gathering plays on the overcloud Tolerate failures on all the plays that run on the overcloud and which potentially run with facts gathering only (no other tasks). Since they can't apply a strategy, we want to let them fail without error. In a later play, we have our tripleo strategies which will figure out if we have reached the maximum of failures that was configured with MaxFailPercentage. Change-Id: I43652972494a9ed1f2b8b483fe19e685cbe4da1b (cherry picked from commit 107b9c4c903924784a9829a405bbdd05b3cb1931) --- common/deploy-steps-playbooks-common.yaml | 21 ++++++++++++++++----- common/deploy-steps.j2 | 1 - 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/common/deploy-steps-playbooks-common.yaml b/common/deploy-steps-playbooks-common.yaml index 5ec1350a7c..e977afcb83 100644 --- a/common/deploy-steps-playbooks-common.yaml +++ b/common/deploy-steps-playbooks-common.yaml @@ -1,3 +1,10 @@ +--- +# If a new play with potential facts gathering is added, make sure we set: +# any_errors_fatal: false +# ignore_unreachable: true +# So we don't break the MaxFailPercentage feature since these plays can't use +# Ansible strategies. + - hosts: all name: Clear cached facts tasks: @@ -7,7 +14,7 @@ name: Gather facts from undercloud gather_facts: yes any_errors_fatal: true - ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}" + ignore_unreachable: false become: false tags: - facts @@ -17,7 +24,11 @@ gather_facts: yes # False because https://github.com/ansible/ansible/issues/70663 any_errors_fatal: false - ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}" + # If an overcloud node is down, we will let MaxFailPercentage + # figuring out if the deployment can continue. For the facts gathering tasks, + # we will simply ignore unreachable nodes and errors, and let the + # Ansible reports the failure in the next plays. + ignore_unreachable: true tags: - facts @@ -25,7 +36,7 @@ name: Load global variables gather_facts: "{{ gather_facts | default(false) }}" any_errors_fatal: false - ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}" + ignore_unreachable: true tasks: - include_vars: global_vars.yaml no_log: true @@ -38,7 +49,7 @@ become: true gather_facts: false any_errors_fatal: false - ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}" + ignore_unreachable: true tasks: - name: Ensure /var/lib/config-data context shell: |- @@ -77,7 +88,7 @@ name: Set all_nodes data as group_vars for overcloud gather_facts: "{{ gather_facts | default(false) }}" any_errors_fatal: false - ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}" + ignore_unreachable: true tasks: - name: Set all_nodes data as group_vars for overcloud include_vars: "{{ playbook_dir }}/group_vars/overcloud.json" diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index e3ba115136..e53f249d2f 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -1144,7 +1144,6 @@ outputs: vars: deploy_source_host: "DEPLOY_SOURCE_HOST" deploy_target_host: "DEPLOY_TARGET_HOST" - scale_ignore_unreachable: true - hosts: DEPLOY_TARGET_HOST name: Scaling