preflight: check that the var is defined for the host before adding it to a map
This commit is contained in:
committed by
Andrew Paglusch
parent
c73ebba5b6
commit
394aabc1d8
@@ -3,7 +3,14 @@
|
||||
block:
|
||||
- name: Collecting all nebula_internal_ip_addr values
|
||||
set_fact:
|
||||
sorted_ips: "{{ hostvars | map('extract', hostvars, ['nebula_internal_ip_addr']) | list | sort }}"
|
||||
sorted_ips: >-
|
||||
{{ hostvars
|
||||
| dict2items
|
||||
| selectattr('value.nebula_internal_ip_addr', 'defined')
|
||||
| map(attribute='value.nebula_internal_ip_addr')
|
||||
| list
|
||||
| sort
|
||||
}}
|
||||
|
||||
- name: Initialize duplicated_ips list
|
||||
set_fact:
|
||||
|
||||
Reference in New Issue
Block a user