Skip to content

Commit 267e7c4

Browse files
gojeaquinocturnalastro
authored andcommitted
Use NetCat instead of ping to test BMC connection, also don't require it for PXE
1 parent 111f215 commit 267e7c4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

roles/validate_inventory/tasks/cluster.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
quiet: true
4646
fail_msg: "Node {{ item }} must have either bmc_ip"
4747
loop: "{{ groups['nodes'] }}"
48+
when: hostvars[item]['vendor'] | lower != 'pxe'
4849

4950
- name: Assert bmc_ip is correct type
5051
assert:

roles/validate_inventory/tasks/network.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
# Node `ansible_host`s are not pinged. They are not required to be running at this stage.
33
# KVM node BMCs are not checked, the vm_host will be pinged later.
4+
# PXE node BMCs are not checked because it is not required
45
- name: Ensure baremetal node BMCs are reachable
56
shell: # noqa 305
6-
cmd: "ping -c 1 -W 2 {{ hostvars[item]['bmc_ip'] | default(hostvars[item]['bmc_address']) }}"
7+
cmd: "nc -vz -u {{ hostvars[item]['bmc_ip'] | default(hostvars[item]['bmc_address']) }}"
78
changed_when: False
8-
when: hostvars[item]['vendor'] | lower != 'kvm'
9+
when: (hostvars[item]['vendor'] | lower != 'kvm') and (hostvars[item]['vendor'] | lower != 'pxe')
910
loop: "{{ groups['nodes'] }}"
1011

1112
- name: Ensure service hosts are reachable

0 commit comments

Comments
 (0)