From: Zack Cerza Date: Fri, 1 Sep 2017 16:16:53 +0000 (-0600) Subject: ceph-grafana: Optionally update alert dashboard X-Git-Tag: v1.0~26^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f345bc34957f676f6d1a8b106db1cd97614d4326;p=cephmetrics.git ceph-grafana: Optionally update alert dashboard Signed-off-by: Zack Cerza --- diff --git a/ansible/README.md b/ansible/README.md index 2261a52..78bc4c1 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -60,6 +60,7 @@ You may override certain variables by creating a `vars.yml` file: - ['1m', '30d'] - ['15m', '5y'] ``` +- `update_alerts`: Whether to update the alerts dashboard along with the rest. Removes any user-defined alerts. Default: false These variables are only relevent when `devel_mode` is true: - `use_epel`: Whether or not to use EPEL and grafana.com instead of ceph.com-sourced packages for dependencies. Default: false diff --git a/ansible/roles/ceph-grafana/defaults/main.yml b/ansible/roles/ceph-grafana/defaults/main.yml index 091e3b4..b569140 100644 --- a/ansible/roles/ceph-grafana/defaults/main.yml +++ b/ansible/roles/ceph-grafana/defaults/main.yml @@ -3,6 +3,7 @@ defaults: # graphite defaults are now in the cephmetrics-common role since the # ceph-collectd role needs access to them replace_dashboards: true + update_alerts: false grafana: datasource: Local # Note: changing this value won't update the password in Grafana itself; diff --git a/ansible/roles/ceph-grafana/tasks/configure_grafana.yml b/ansible/roles/ceph-grafana/tasks/configure_grafana.yml index b7b2ec4..de3d047 100644 --- a/ansible/roles/ceph-grafana/tasks/configure_grafana.yml +++ b/ansible/roles/ceph-grafana/tasks/configure_grafana.yml @@ -143,6 +143,6 @@ - dashboards - name: Push dashboards to Grafana - command: "{{ dashupdate_cmd }} -m {{ dashupdate_mode }} -c /tmp/dashboard.yml -D {{ dashboard_dir }}" + command: "{{ dashupdate_cmd }} -m {{ dashupdate_mode }} -c /tmp/dashboard.yml -D {{ dashboard_dir }}{{ ' -A' if update_alerts else '' }}" tags: - dashboards