2019-03-15 04:22:01 +08:00
|
|
|
---
|
|
|
|
- name: "fail if {{ inventory_hostname }} does not have any {{ ip_version }} address on {{ monitor_address_block }}"
|
|
|
|
fail:
|
|
|
|
msg: "{{ inventory_hostname }} does not have any {{ ip_version }} address on {{ monitor_address_block }}"
|
2021-03-03 22:43:50 +08:00
|
|
|
when: hostvars[inventory_hostname]['ansible_facts']['all_' + ip_version + '_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['monitor_address_block'].split(',')) | length == 0
|