Skip to content

Commit

Permalink
Merge pull request #430 from rebtoor/nodes_validation_production_profile
Browse files Browse the repository at this point in the history
Make `edpm_nodes_validation` role compliant with ansible-lint `production` profile
  • Loading branch information
openshift-ci[bot] authored Oct 10, 2023
2 parents c4fdfd7 + 5d8323b commit 26fe00b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions roles/edpm_nodes_validation/tasks/ping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@
INT=$(ip ro get {{ controller }} | head -1 | sed -nr "s/.* dev (\w+) .*/\1/p")
MTU=$(cat /sys/class/net/${INT}/mtu 2>/dev/null || echo "0")
echo "$INT $MTU"
changed_when:
- _nic_mtu.stdout.split()[0] != ""
- _nic_mtu.stdout.split()[1] != ""
failed_when:
- _nic_mtu.stdout.split()[0] == ""
- _nic_mtu.stdout.split()[1] == ""
- name: Set interface vars
ansible.builtin.set_fact:
_nic: "{{ _nic_mtu.stdout.split()[0] | default('lo') }}"
_mtu: "{{ _nic_mtu.stdout.split()[1] | default(0) | int - 28 }}"
- name: Network availability validation block
when:
- not ansible_check_mode|bool
- not ansible_check_mode | bool
- _nic != 'lo'
block:
- name: Check IP responsiveness
Expand All @@ -41,7 +47,7 @@
register: ping_result
until: ping_result.rc == 0

- name: Validate packet with {{ _mtu }} MTU size can reach controller from {{ _nic }}
- name: Validate packet with given MTU size can reach controller from {{ _nic }}
ansible.builtin.command: "{{ _ping_cmd }} -w 10 -s {{ _mtu }} -c 5 {{ controller }}"
retries: 10
delay: 60
Expand Down

0 comments on commit 26fe00b

Please sign in to comment.