DEV-452: added workaround to fix problem with missing hetzner internal network

feature/DEV-380
friedrich goerz 4 years ago
parent f7a43f5981
commit cd09b5bb5e

@ -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

@ -9,6 +9,10 @@
name: hcloud
tasks_from: _set_server_state
# step needed to catch hetzner errors on servers where internal network not ready
# => will result in fails of ansible run due to expecting two IPv4 addresses in
# ansible_all_ipv4_addresses but only one was found
# => DEV-452
- name: "Checking if internal network up and runnig for <{{ inventory_hostname }}>"
include_role:
name: hcloud

Loading…
Cancel
Save