Merge "Add the MTU size to ping to catch network issues"

This commit is contained in:
Zuul 2021-11-09 00:43:48 +00:00 committed by Gerrit Code Review
commit a6421dc36c
2 changed files with 41 additions and 4 deletions

View File

@ -46,13 +46,10 @@
- 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
delay: 60
include_tasks: ping.yml
loop_control:
loop_var: controller
loop: "{{ tripleo_nodes_validation_ping_test_ips }}"
changed_when: false
when:
- tripleo_nodes_validation_validate_controllers_icmp|bool
- tripleo_nodes_validation_ping_test_ips | length > 0

View File

@ -0,0 +1,40 @@
---
# Copyright 2021 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Get nic for ping
shell: |-
ip ro get {{ controller }} | head -1 | sed 's/.*dev \(.*\) src.*/\1/'
register: nic_for_ping
- name: network availability validation block
block:
- name: Get MTU for {{ nic_for_ping.stdout }}
shell: |-
ip link show {{ nic_for_ping.stdout }} | head -1 | sed 's/.*mtu \(.*\) qdisc.*/\1/'
register: mtu_for_nic
- name: Check IP responsiveness
command: "{{ (':' in controller) | ternary('ping6', 'ping') }} -w 10 -c 1 {{ controller }}"
retries: 10
delay: 60
changed_when: false
- name: Validate packet with given MTU size can reach controller
command: "{{ (':' in controller) | ternary('ping6', 'ping') }} -w 10 -s {{ mtu_for_nic.stdout | int - 28 }} -c 1 {{ controller }}"
retries: 10
delay: 60
changed_when: false
when: nic_for_ping.stdout != 'lo'