Fix node health validation with inventory changes

The inventory now uses host names in groups instead of IPs which cannot be
directly used to ping hosts in the node health validation.

The IPs are now collected from the meta hostvars dictionary.

Change-Id: I75f3dcd5e29ae26fdc65ef093f8c207163ed1fff
This commit is contained in:
Florian Fuchs 2018-05-08 14:01:53 +00:00 committed by Gael Chamoulaud
parent 1440a5a539
commit 89e09b58fb
1 changed files with 5 additions and 1 deletions

View File

@ -9,10 +9,14 @@
groups:
- pre-upgrade
tasks:
- name: Collect IPs for overcloud nodes
set_fact: ansible_host="{{ hostvars[item]['ansible_host'] }}"
register: oc_ips
with_items: "{{ groups.overcloud }}"
- name: Ping all overcloud nodes
icmp_ping:
host: "{{ item }}"
with_items: "{{ groups.overcloud }}"
with_items: "{{ oc_ips.results | map(attribute='ansible_facts.ansible_host') | list }}"
ignore_errors: true
register: ping_results
- name: Extract failed pings