Skip to content

Commit

Permalink
PMM-7 fix UI upgrade (#2491)
Browse files Browse the repository at this point in the history
* PMM-7 Fix UI upgrade.

* PMM-7 Fix UI upgrade.
  • Loading branch information
BupycHuk authored Sep 19, 2023
1 parent 181fdd6 commit bb159fa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,6 @@
state: absent
path: /usr/share/pmm-server/maintenance/maintenance.html
# We use current_version_file['failed'] because we don't want to run this on creating container
when: not ui_upgrade and current_version_file['failed'] == false
when: not ui_upgrade and current_version_file['failed'] == false and not pmm_current_version is version(pmm_image_version, '>=')


46 changes: 23 additions & 23 deletions update/ansible/playbook/tasks/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,29 @@
- /etc/yum/yum-cron-hourly.conf
- /etc/yum/yum-cron.conf

- name: Check that the SQLite grafana database exists
stat:
path: /srv/grafana/grafana.db
register: is_database_sqlite

- name: Migrate Grafana database from SQLite to Postgresql
include_role:
name: sqlite-to-postgres
when: is_database_sqlite.stat.exists
tags:
- skip_ansible_lint # '503 Tasks that run when changed should likely be handlers'.

- name: Fix grafana fields type
postgresql_query:
db: grafana
query: "{{ item }}"
loop:
- ALTER TABLE tag ALTER COLUMN key TYPE text;
- ALTER TABLE tag ALTER COLUMN value TYPE text;
- ALTER TABLE api_key ALTER COLUMN key TYPE text;
- ALTER TABLE api_key ALTER COLUMN name TYPE text;
when: not ansible_check_mode

# Regenerating to enable pmm-update-perform-init
- name: Generate new supervisor config
command: pmm-managed-init
Expand Down Expand Up @@ -430,29 +453,6 @@
- name: Print other services's logs
debug: var=update_result.stdout_lines

- name: Check that the SQLite grafana database exists
stat:
path: /srv/grafana/grafana.db
register: is_database_sqlite

- name: Migrate Grafana database from SQLite to Postgresql
include_role:
name: sqlite-to-postgres
when: is_database_sqlite.stat.exists
tags:
- skip_ansible_lint # '503 Tasks that run when changed should likely be handlers'.

- name: Fix grafana fields type
postgresql_query:
db: grafana
query: "{{ item }}"
loop:
- ALTER TABLE tag ALTER COLUMN key TYPE text;
- ALTER TABLE tag ALTER COLUMN value TYPE text;
- ALTER TABLE api_key ALTER COLUMN key TYPE text;
- ALTER TABLE api_key ALTER COLUMN name TYPE text;
when: not ansible_check_mode

- name: Wait for PMM to be ready
ansible.builtin.uri:
url: "http://127.0.0.1:7772/v1/readyz"
Expand Down

0 comments on commit bb159fa

Please sign in to comment.