--- # 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: "Exec setup again to catch e.g. new network interfaces" ansible.builtin.setup: gather_subset: - network - virtual - 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