From 71a8917a1cb80f8ae0fbd104221a98e97d0acadf Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 15 Jul 2020 13:58:44 -0400 Subject: [PATCH] deploy-steps-playbooks-common: fix logic for scale_ignore_unreachable For all the tasks in common/deploy-steps-playbooks-common.yaml: * any_errors_fatal will be set to False for all tasks as this is shared with the scale tasks or where nodes may not be available. Due to https://github.com/ansible/ansible/issues/70663 this cannot be set dynamically at this time. If an error occurs it'll get picked up by a future task. * Add ignore_unreachable to all the tasks which didn't have it before (and set it to scale_ignore_unreachable | default(false)) This will allow a scale-down to work fine when a node that is being scaled down is unreachable. Change-Id: Ib69b9127f530ff8063a1c7408a70e20cfc7babc7 Closes-Bug: #1887702 (cherry picked from commit af30d7d290287491f0a46c471a892f6e870eef84) --- common/deploy-steps-playbooks-common.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/common/deploy-steps-playbooks-common.yaml b/common/deploy-steps-playbooks-common.yaml index 163fbc0530..975aea55f2 100644 --- a/common/deploy-steps-playbooks-common.yaml +++ b/common/deploy-steps-playbooks-common.yaml @@ -6,7 +6,7 @@ - hosts: "{{ deploy_source_host }}" name: Gather facts from undercloud gather_facts: yes - any_errors_fatal: "{{ not scale_ignore_unreachable | default(true) }}" + any_errors_fatal: true ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}" become: false tags: @@ -15,7 +15,8 @@ - hosts: "{{ deploy_target_host }}" name: Gather facts from overcloud gather_facts: yes - any_errors_fatal: "{{ not scale_ignore_unreachable | default(true) }}" + # False because https://github.com/ansible/ansible/issues/70663 + any_errors_fatal: false ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}" tags: - facts @@ -23,7 +24,7 @@ - hosts: all name: Load global variables gather_facts: "{{ gather_facts | default(false) }}" - any_errors_fatal: "{{ not scale_ignore_unreachable | default(true) }}" + any_errors_fatal: false ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}" tasks: - include_vars: global_vars.yaml @@ -35,7 +36,8 @@ name: Ensure /var/lib/config-data context become: true gather_facts: false - any_errors_fatal: yes + any_errors_fatal: false + ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}" tasks: - name: Ensure /var/lib/config-data context shell: |- @@ -56,7 +58,9 @@ - hosts: "{{ deploy_target_host }}" name: Render all_nodes data as group_vars for overcloud gather_facts: "{{ gather_facts | default(false) }}" - any_errors_fatal: yes + # we don't skip errors or ignore unreachable on this one because it's + # delegated to localhost. localhost should never be unreachable (tm) + any_errors_fatal: True tasks: - name: Render all_nodes data as group_vars for overcloud delegate_to: localhost @@ -71,7 +75,8 @@ - hosts: "{{ deploy_target_host }}" name: Set all_nodes data as group_vars for overcloud gather_facts: "{{ gather_facts | default(false) }}" - any_errors_fatal: yes + any_errors_fatal: false + ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}" tasks: - name: Set all_nodes data as group_vars for overcloud include_vars: "{{ playbook_dir }}/group_vars/overcloud.json"