Bring db setup vars in line with other roles

Allows for galera_db_setup_host to be overridden if necessary for delegation.
Brings the format in line with the db_setup vars in other roles.

Change-Id: Ie2a802ebb8297bed03d74b3cf54907322b858896
This commit is contained in:
Georgina Shippey 2021-01-20 14:13:55 +00:00
parent b0e4cb8953
commit 8ce7da7a3c
2 changed files with 6 additions and 5 deletions

View File

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

View File

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