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 70a37f4ec8)
This commit is contained in:
Harald Jensås 2021-10-28 22:47:41 +02:00
parent 1f134c554f
commit 66eeb8fd73
2 changed files with 14 additions and 0 deletions

View File

@ -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: []

View File

@ -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