grafana: add bootstrap during upgrade

Upgrading from Victoria to Wallaby with Monasca enabled fails waiting
for Grafana to start.

Grafana defaults to enabled if Monasca is enabled in Wallaby (was
default disabled in Victoria), so the database user and tables don't
necessarily exist prior to the upgrade.

Running `kolla-ansible upgrade` then attempts to start the Grafana
container, but fails to include the bootstrap task (which creates the
db) so the container is unable to start with a database connection
error, from the grafana container logs:

  service init failed: failed to check table existence: Error 1045:
  Access denied for user 'grafana'@'xxx' (using password: YES)

This change performs a bootstrap of Grafana during upgrade. It is
required only for the Wallaby release where the default change is
introduced.

Closes-Bug: #1931037
Co-Authored-By: Scott Shambarger

Change-Id: Ib32b78cfd6f3fe535d30d8aa48f3187b9aec746e
This commit is contained in:
Mark Goddard 2021-06-07 10:34:36 +01:00
parent f44d638c10
commit 12dc474830
1 changed files with 5 additions and 0 deletions

View File

@ -29,5 +29,10 @@
- inventory_hostname != groups['grafana']|first
- grafana_differs['result']
# NOTE(mgoddard): Bootstrap during upgrade added for Wallaby only, since
# Monasca users will get grafana enabled by default, when previously they may
# have been using monasca-grafana.
- import_tasks: bootstrap.yml
- name: Flush handlers
meta: flush_handlers