|
|
|
|
@ -1,13 +1,8 @@
|
|
|
|
|
---
|
|
|
|
|
# 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: "Increment the retry count"
|
|
|
|
|
set_fact:
|
|
|
|
|
retry_count: "{{ retry_count | default(0) | int + 1 }}"
|
|
|
|
|
|
|
|
|
|
- name: "DEBUG"
|
|
|
|
|
debug:
|
|
|
|
|
msg: "current retry_count: {{ retry_count }}"
|
|
|
|
|
|
|
|
|
|
- name: "DEBUG"
|
|
|
|
|
debug:
|
|
|
|
|
@ -22,16 +17,6 @@
|
|
|
|
|
that:
|
|
|
|
|
- ansible_all_ipv4_addresses | length == 2
|
|
|
|
|
rescue:
|
|
|
|
|
- name: "RESCUE - fail: Maximum retries reached"
|
|
|
|
|
fail:
|
|
|
|
|
msg: "max_retries of {{ max_retries }} reached. Plz check."
|
|
|
|
|
when: retry_count | int == max_retries | int
|
|
|
|
|
|
|
|
|
|
- name: "RESCUE: wait_for {{ retry_delay }} sec. between retries"
|
|
|
|
|
wait_for:
|
|
|
|
|
timeout: "{{ retry_delay }}"
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
become: false
|
|
|
|
|
|
|
|
|
|
- name: "Include _check_for_internal_address.yml one time again => increase retry_count"
|
|
|
|
|
include_tasks: _check_for_internal_address.yml
|
|
|
|
|
- name: "Include _set_server_state.yml to hopefully fix error with throwing server object against hetzner API"
|
|
|
|
|
include_tasks: _set_server_state.yml
|
|
|
|
|
|