Merge "Repair MariaDB tables after upgrade"

This commit is contained in:
Zuul 2022-08-03 12:49:18 +00:00 committed by Gerrit Code Review
commit d6e6d647c7
2 changed files with 18 additions and 0 deletions

View File

@ -77,6 +77,19 @@
mysql_socket_path: "/var/run/mysql/mysql.sock"
when: (ansible_os_family | lower) not in ['redhat', 'debian']
# NOTE(mgoddard): This should be done after starting the database, but before
# using it.
- name: "MySQL - Upgrade"
command:
cmd: >-
mysql_upgrade
{% if mysql_socket_path %}--socket={{ mysql_socket_path }}{% endif %}
{% if mysql_username is defined %}--user={{ mysql_username }}{% endif %}
{% if mysql_password is defined %}--password={{ mysql_password }}{% endif %}
register: mysql_upgrade_result
changed_when: "'is already upgraded' not in mysql_upgrade_result.stdout"
when: ironic.database.host == 'localhost'
- name: "MySQL - Creating DB"
mysql_db:
login_unix_socket: "{{ mysql_socket_path | default(omit) }}"

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixes an issue where the MariaDB database tables were not repaired
following an upgrade of MariaDB.