fail:
msg: "{{ monitor_interface }} is not active on {{ inventory_hostname }}"
when:
- - not hostvars[inventory_hostname]['ansible_' + monitor_interface]['active']
+ - not hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['active']
- name: "fail if {{ monitor_interface }} does not have any ip v4 address on {{ inventory_hostname }}"
fail:
msg: "{{ monitor_interface }} does not have any IPv4 address on {{ inventory_hostname }}"
when:
- ip_version == "ipv4"
- - hostvars[inventory_hostname]['ansible_' + monitor_interface]['ipv4'] is not defined
+ - hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['ipv4'] is not defined
- name: "fail if {{ monitor_interface }} does not have any ip v6 address on {{ inventory_hostname }}"
fail:
msg: "{{ monitor_interface }} does not have any IPv6 address on {{ inventory_hostname }}"
when:
- ip_version == "ipv6"
- - hostvars[inventory_hostname]['ansible_' + monitor_interface]['ipv6'] is not defined
\ No newline at end of file
+ - hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['ipv6'] is not defined
fail:
msg: "{{ radosgw_interface }} is not active on {{ inventory_hostname }}"
when:
- - hostvars[inventory_hostname]['ansible_' + radosgw_interface]['active'] == "false"
+ - hostvars[inventory_hostname]['ansible_' + (radosgw_interface | replace('-', '_'))]['active'] == "false"
- name: "fail if {{ radosgw_interface }} does not have any ip v4 address on {{ inventory_hostname }}"
fail:
msg: "{{ radosgw_interface }} does not have any IPv4 address on {{ inventory_hostname }}"
when:
- ip_version == "ipv4"
- - hostvars[inventory_hostname]['ansible_' + radosgw_interface]['ipv4'] is not defined
+ - hostvars[inventory_hostname]['ansible_' + (radosgw_interface | replace('-', '_'))]['ipv4'] is not defined
- name: "fail if {{ radosgw_interface }} does not have any ip v6 address on {{ inventory_hostname }}"
fail:
msg: "{{ radosgw_interface }} does not have any IPv6 address on {{ inventory_hostname }}"
when:
- ip_version == "ipv6"
- - hostvars[inventory_hostname]['ansible_' + radosgw_interface]['ipv6'] is not defined
\ No newline at end of file
+ - hostvars[inventory_hostname]['ansible_' + (radosgw_interface | replace('-', '_'))]['ipv6'] is not defined