DEV-452: tried to fix some stuff

feature/DEV-380
friedrich goerz 4 years ago committed by Görz, Friedrich
parent 10bd066617
commit 0fe89b4985

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

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

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

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

Loading…
Cancel
Save