diff --git a/defaults/main.yml b/defaults/main.yml index c1ced755..0650c6ab 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -206,6 +206,10 @@ galera_client_my_cnf_overrides: {} # "galera_server" group and fall back to localhost. galera_ssl_server: "{{ (galera_cluster_members | default(['localhost']))[0] }}" +## Database info +galera_db_setup_host: "{{ openstack_db_setup_host | default(galera_cluster_members[0] | default('localhost')) }}" +galera_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((galera_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}" + # Configure backups of database # copies is the number of full backups to be kept, the corresponding # incremental backups will also be kept. Uses systemd timer instead of cron. diff --git a/tasks/galera_server_backups.yml b/tasks/galera_server_backups.yml index a8e837ad..b3519f52 100644 --- a/tasks/galera_server_backups.yml +++ b/tasks/galera_server_backups.yml @@ -79,12 +79,9 @@ when: galera_mariadb_backups_increment_on_calendar is defined - name: Grant access to the database for the backup service - delegate_to: "{{ openstack_db_setup_host | default('localhost') }}" + delegate_to: "{{ galera_db_setup_host }}" vars: - galera_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}" - ansible_python_interpreter: "{{ openstack_db_setup_python_interpreter | - default((galera_db_setup_host == 'localhost') | - ternary(ansible_playbook_python, ansible_python['executable'])) }}" + ansible_python_interpreter: "{{ galera_db_setup_python_interpreter }}" community.mysql.mysql_user: name: "{{ galera_mariadb_backups_user }}" password: "{{ galera_mariadb_backups_password }}"