You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hetzner-ansible/roles/hcloud/tasks/_check_for_internal_address...

26 lines
937 B
YAML

---
# bunch of task statements needed to check if internal network is accessible or not
# if not, call _set_server_state.yml
- name: "Block to handle missing internal hetzner server network"
block:
- name: "DEBUG"
debug:
msg: "ansible_all_ipv4_addresses: {{ ansible_all_ipv4_addresses }}"
- name: "DEBUG"
debug:
msg: "ansible_all_ipv4_addresses-FILTERED: {{ ansible_all_ipv4_addresses | ansible.netcommon.ipaddr(shared_service_network) }}"
- name: "DEBUG - break if only one IPv4-address was found"
assert:
that:
- ansible_all_ipv4_addresses | length == 2
rescue:
- name: "Include _set_server_state.yml to hopefully fix error with throwing server object against hetzner API"
include_tasks: _set_server_state.yml
- name: "Include _check_for_internal_address.yml to check again if internal network is available"
include_tasks: _check_for_internal_address.yml