Skip to content

Commit

Permalink
PMM-12045 transition to unified grafana binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Tymchuk committed Jul 15, 2023
1 parent 8348a59 commit bc60f68
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 27 deletions.
8 changes: 1 addition & 7 deletions build/ansible/roles/pmm2-images/files/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@
[program:grafana]
priority = 3
command =
/usr/sbin/grafana-server
/usr/sbin/grafana server
--homepath=/usr/share/grafana
--config=/etc/grafana/grafana.ini
cfg:default.paths.data=/srv/grafana
cfg:default.paths.plugins=/srv/grafana/plugins
cfg:default.paths.logs=/srv/logs
cfg:default.log.mode=console
cfg:default.log.console.format=console
cfg:default.server.root_url="https://%%(domain)s/graph"

user = grafana
directory = /usr/share/grafana
Expand Down
2 changes: 1 addition & 1 deletion build/packages/deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ case "$1" in
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
echo "postinst called with unknown argument '$1'" >&2
exit 1
;;
esac
Expand Down
8 changes: 1 addition & 7 deletions managed/services/supervisord/supervisord.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,15 +779,9 @@ redirect_stderr = true
[program:grafana]
priority = 3
command =
/usr/sbin/grafana-server
/usr/sbin/grafana server
--homepath=/usr/share/grafana
--config=/etc/grafana/grafana.ini
cfg:default.paths.data=/srv/grafana
cfg:default.paths.plugins=/srv/grafana/plugins
cfg:default.paths.logs=/srv/logs
cfg:default.log.mode=console
cfg:default.log.console.format=console
cfg:default.server.root_url="https://%%(domain)s/graph"
{{- if .PerconaSSODetails}}
cfg:default.server.domain="{{ .PMMServerAddress }}"
cfg:default.auth.generic_oauth.enabled=true
Expand Down
8 changes: 1 addition & 7 deletions managed/testdata/supervisord.d/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@
[program:grafana]
priority = 3
command =
/usr/sbin/grafana-server
/usr/sbin/grafana server
--homepath=/usr/share/grafana
--config=/etc/grafana/grafana.ini
cfg:default.paths.data=/srv/grafana
cfg:default.paths.plugins=/srv/grafana/plugins
cfg:default.paths.logs=/srv/logs
cfg:default.log.mode=console
cfg:default.log.console.format=console
cfg:default.server.root_url="https://%%(domain)s/graph"
environment =
PERCONA_TEST_POSTGRES_ADDR="",
PERCONA_TEST_POSTGRES_DBNAME="",
Expand Down
2 changes: 1 addition & 1 deletion update/ansible/playbook/tasks/files/change-admin-password
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# Change password for default admin user in PMM

grafana-cli --config=/etc/grafana/grafana.ini --homepath /usr/share/grafana --configOverrides cfg:default.paths.data=/srv/grafana admin reset-admin-password $1
grafana cli --config=/etc/grafana/grafana.ini --homepath /usr/share/grafana admin reset-admin-password $1
8 changes: 8 additions & 0 deletions update/ansible/playbook/tasks/roles/grafana/files/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@
[paths]
# Directory where grafana will automatically scan and look for plugins
plugins = /srv/grafana/plugins
logs = /srv/logs
data = /srv/grafana

#################################### Logging ##########################
[log]
mode = console

#################################### Server ####################################
[server]
# enable gzip
enable_gzip = true
# The full public facing url
root_url = https://%(domain)s/graph

#################################### Snapshots ###########################
[snapshots]
Expand Down
8 changes: 4 additions & 4 deletions update/ansible/playbook/tasks/roles/grafana/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
state: directory
owner: grafana
group: grafana
mode: '0775'
mode: "0775"
loop:
- /srv/grafana
- /srv/grafana/plugins

- name: Set Grafana folder for plugins on /srv partition for all users
lineinfile:
path: /etc/bashrc
line: 'export GF_PLUGIN_DIR=/srv/grafana/plugins'
line: "export GF_PLUGIN_DIR=/srv/grafana/plugins"

- name: Copy new version of grafana.ini
copy:
src: grafana.ini
dest: /etc/grafana/grafana.ini
owner: grafana
group: grafana
mode: '0444'
mode: "0444"

- name: Create provisioning directory
file:
Expand All @@ -46,5 +46,5 @@
- dashboards

- name: Upgrade grafana database (Get the latest schema)
command: grafana-cli --homepath=/usr/share/grafana admin data-migration encrypt-datasource-passwords
command: grafana cli --homepath=/usr/share/grafana admin data-migration encrypt-datasource-passwords
changed_when: True

0 comments on commit bc60f68

Please sign in to comment.