From 66eeb8fd737ea736eb293ffbc27d168b984552fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Thu, 28 Oct 2021 22:47:41 +0200 Subject: [PATCH] Add ping test for all networks gateway IPs Add ping test for gateway IPs on all networks, to ensure all gateways are reachable. The releated Bugzilla reports an issue where some network fabrics fail when using the current node ping test, which pings the first node in each role. The fabric simply does not forward traffic before the gateway has been pinged. One can argue that the fabric in question is broken. However, with the current implementation the first node in each role actually ping tests only against it's own address? So adding the test to ping the gateway addresses improves the validation in general. Related RHBZ#1875962 Change-Id: I93cded61ffb862e99fd8043dbf0def3d16079692 (cherry picked from commit 70a37f4ec8b61c784aed051322aa0dfc84ebdfee) --- .../tripleo_nodes_validation/defaults/main.yml | 1 + .../roles/tripleo_nodes_validation/tasks/main.yml | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/tripleo_ansible/roles/tripleo_nodes_validation/defaults/main.yml b/tripleo_ansible/roles/tripleo_nodes_validation/defaults/main.yml index 8e5644c71..89d8f87cd 100644 --- a/tripleo_ansible/roles/tripleo_nodes_validation/defaults/main.yml +++ b/tripleo_ansible/roles/tripleo_nodes_validation/defaults/main.yml @@ -25,3 +25,4 @@ tripleo_nodes_validation_tripleo_role_name: true tripleo_nodes_validation_validate_controllers_icmp: true tripleo_nodes_validation_validate_fqdn: false tripleo_nodes_validation_validate_gateway_icmp: true +tripleo_nodes_validation_ping_test_gateway_ips: [] diff --git a/tripleo_ansible/roles/tripleo_nodes_validation/tasks/main.yml b/tripleo_ansible/roles/tripleo_nodes_validation/tasks/main.yml index c04c83203..88826a91e 100644 --- a/tripleo_ansible/roles/tripleo_nodes_validation/tasks/main.yml +++ b/tripleo_ansible/roles/tripleo_nodes_validation/tasks/main.yml @@ -32,6 +32,19 @@ - ansible_facts.default_ipv4 is defined - ansible_facts.default_ipv4.gateway is defined +# Ping test the gateway IPs before nodes, see RHBZ#1875962 +- name: Check all networks Gateway availability + command: "{{ (':' in gateway_ip) | ternary('ping6', 'ping') }} -w 10 -c 1 {{ gateway_ip }}" + retries: 10 + delay: 60 + loop_control: + loop_var: gateway_ip + loop: "{{ tripleo_nodes_validation_ping_test_gateway_ips }}" + changed_when: false + when: + - tripleo_nodes_validation_validate_gateway_icmp|bool + - tripleo_nodes_validation_ping_test_gateway_ips | length > 0 + - name: Check Controllers availability command: "{{ (':' in controller) | ternary('ping6', 'ping') }} -w 10 -c 1 {{ controller }}" retries: 10