From 0fe89b49851e95d0e2896c193348dcb70bb3311f Mon Sep 17 00:00:00 2001 From: friedrich goerz Date: Tue, 3 May 2022 13:29:39 +0200 Subject: [PATCH] DEV-452: tried to fix some stuff --- .../tasks/_check_for_internal_address.yml | 31 ------------------- roles/hcloud/tasks/main.yml | 9 ------ roles/maria/tasks/main.yml | 2 +- roles/restore_maria/tasks/main.yml | 2 +- 4 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 roles/hcloud/tasks/_check_for_internal_address.yml diff --git a/roles/hcloud/tasks/_check_for_internal_address.yml b/roles/hcloud/tasks/_check_for_internal_address.yml deleted file mode 100644 index bcab3bd..0000000 --- a/roles/hcloud/tasks/_check_for_internal_address.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -# 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 diff --git a/roles/hcloud/tasks/main.yml b/roles/hcloud/tasks/main.yml index e26279e..bd880d4 100644 --- a/roles/hcloud/tasks/main.yml +++ b/roles/hcloud/tasks/main.yml @@ -9,15 +9,6 @@ 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 - tasks_from: _check_for_internal_address - - name: "Gathering current server infos from hetzner" hcloud_server_info: api_token: "{{ hetzner_authentication_ansible }}" diff --git a/roles/maria/tasks/main.yml b/roles/maria/tasks/main.yml index 42cb3f2..8993447 100644 --- a/roles/maria/tasks/main.yml +++ b/roles/maria/tasks/main.yml @@ -44,7 +44,7 @@ ansible.builtin.lineinfile: path: /etc/mysql/mariadb.conf.d/50-server.cnf regexp: '^bind-address' - line: 'bind-address={{ ansible_all_ipv4_addresses | ansible.netcommon.ipaddr(shared_service_network) | first }}' + line: 'bind-address={{ stage_private_server_ip }}' notify: restart mysql # DEV-422: SSL stuff does not work as expected diff --git a/roles/restore_maria/tasks/main.yml b/roles/restore_maria/tasks/main.yml index 51bc3dc..8307968 100644 --- a/roles/restore_maria/tasks/main.yml +++ b/roles/restore_maria/tasks/main.yml @@ -25,7 +25,7 @@ - mariadb-client - mariadb-server - mariadb-backup - mysql_bind_address: '{{ ansible_all_ipv4_addresses | ansible.netcommon.ipaddr(shared_service_network) | first }}' + mysql_bind_address: '{{ stage_private_server_ip }}' # mysql_config_include_files: # - src: 50-ssl.cnf include_role: