From: Boris Ranto Date: Wed, 10 Jul 2019 08:19:53 +0000 (+0200) Subject: grafana: Add option to preserve grafana config X-Git-Tag: v2.0.6~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6c87e9f7a737f0632b266fd65a9b8bf8616d2758;p=cephmetrics.git grafana: Add option to preserve grafana config This patch adds the grafana.overwrite_config option. You can change this option if you want to keep your custom grafana configuration. The scripts will still update the grafana config with the other configured options but it won't overwrite your custom options. Signed-off-by: Boris Ranto --- diff --git a/ansible/group_vars/all.yml.sample b/ansible/group_vars/all.yml.sample index bb42c1c..b74f6cc 100644 --- a/ansible/group_vars/all.yml.sample +++ b/ansible/group_vars/all.yml.sample @@ -27,3 +27,7 @@ dummy: # smtp_password: password # If you like to enable Anonymous login, set auth_anonymous to true # auth_anonymous: false +# You can change this option if you want to keep your custom grafana configuration. +# The script will still update the grafana config with the other configured options +# but it won't overwrite your custom options. +# overwrite_config: true diff --git a/ansible/roles/ceph-grafana/defaults/main.yml b/ansible/roles/ceph-grafana/defaults/main.yml index 6eb03f5..6eefc49 100644 --- a/ansible/roles/ceph-grafana/defaults/main.yml +++ b/ansible/roles/ceph-grafana/defaults/main.yml @@ -23,6 +23,10 @@ defaults: default_theme: light snmp_enabled: false auth_anonymous: false + # You can change this option if you want to keep your custom grafana configuration. + # The script will still update the grafana config with the other configured options + # but it won't overwrite your custom options. + overwrite_config: true plugins: - vonage-status-panel - grafana-piechart-panel diff --git a/ansible/roles/ceph-grafana/tasks/configure_grafana.yml b/ansible/roles/ceph-grafana/tasks/configure_grafana.yml index 05eddb6..6560d66 100644 --- a/ansible/roles/ceph-grafana/tasks/configure_grafana.yml +++ b/ansible/roles/ceph-grafana/tasks/configure_grafana.yml @@ -16,6 +16,7 @@ owner: root group: grafana mode: 0640 + force: "{{ grafana.overwrite_config }}" tags: [ini] - name: Set owner on /etc/grafana