Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Commit

Permalink
PMM-7 revert migration grafana to postgres (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-b committed Apr 12, 2022
1 parent 4381425 commit 7e50c88
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
supervisorctl:
name: grafana
state: restarted
ignore_errors: yes

- name: Display grafana.log content
command: cat /srv/logs/grafana.log
Expand Down
12 changes: 0 additions & 12 deletions ansible/playbook/tasks/roles/grafana/files/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ plugins = /srv/grafana/plugins
# enable gzip
enable_gzip = true

#################################### Database ####################################
[database]
# You can configure the database connection by specifying type, host, name, user and password
# as separate properties or as on string using the url properties.

# Either "mysql", "postgres" or "sqlite3", it's your choice
type = postgres
host = localhost
user = grafana
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
password = grafana

#################################### Snapshots ###########################
[snapshots]
# snapshot sharing options
Expand Down
27 changes: 0 additions & 27 deletions ansible/playbook/tasks/roles/initialization/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,3 @@
include_role:
name: postgres-ascii-to-utf8
when: "'SQL_ASCII' == postgres_encoding.query_result[0].server_encoding"

- name: Create grafana database
postgresql_db:
name: grafana
state: present

- name: Create grafana user
postgresql_user:
db: grafana
name: grafana
password: grafana
priv: 'ALL'
expires: infinity
state: present
when: not ansible_check_mode

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

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

This file was deleted.

119 changes: 0 additions & 119 deletions ansible/playbook/tasks/roles/sqlite-to-postgres/tasks/main.yml

This file was deleted.

14 changes: 0 additions & 14 deletions ansible/playbook/tasks/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@
- percona-grafana
state: latest

- name: Install grafana-migrate
yum:
name: "grafana-db-migrator"
state: latest

- name: Create grafana config
include_role:
name: grafana
Expand Down Expand Up @@ -216,15 +211,6 @@
regexp: "set -o errexit"
replace: ""

- 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;
when: not ansible_check_mode

# TODO: Create /srv/alertmanager/data and /srv/victoriametrics/data in pmm-managed
# to support Docker-way (swap image) updates.
# https://jira.percona.com/browse/PMM-7024
Expand Down

0 comments on commit 7e50c88

Please sign in to comment.