From: Zack Cerza Date: Thu, 13 Jul 2017 18:21:09 +0000 (-0600) Subject: Make whisper retention settings configurable X-Git-Tag: v1.0~41^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=948e59c0d789258d7a3489410620acf3c92d8163;p=cephmetrics.git Make whisper retention settings configurable The first value must be '10s', still, for consistency with collectd Signed-off-by: Zack Cerza --- diff --git a/ansible/roles/ceph-grafana/defaults/main.yml b/ansible/roles/ceph-grafana/defaults/main.yml index 0668af7..48caca2 100644 --- a/ansible/roles/ceph-grafana/defaults/main.yml +++ b/ansible/roles/ceph-grafana/defaults/main.yml @@ -21,6 +21,11 @@ carbon: storage_dir: yum: /var/lib/carbon apt: /var/lib/graphite +whisper: + retention: + - ['10s', '7d'] + - ['1m', '30d'] + - ['15m', '5y'] # The firewalld zone that carbon and grafana will use firewalld_zone: public # RHEL repos that need to be enabled with subscription-manager diff --git a/ansible/roles/ceph-grafana/tasks/configure_carbon.yml b/ansible/roles/ceph-grafana/tasks/configure_carbon.yml index cb6b728..1f36185 100644 --- a/ansible/roles/ceph-grafana/tasks/configure_carbon.yml +++ b/ansible/roles/ceph-grafana/tasks/configure_carbon.yml @@ -8,10 +8,15 @@ notify: - Restart carbon-cache +- name: Fail when the the first whisper retention value is not 10s + fail: + msg: "The first whisper retention value must be '10s', not '{{ whisper.retention[0][0] }}'" + failed_when: whisper.retention[0][0] != '10s' + any_errors_fatal: true + - name: Set whisper_retention set_fact: - # Changing collectd_interval is not supported at this time - whisper_retention: "{{ collectd_interval|default('10') }}s:7d,1m:30d,15m:5y" + whisper_retention: "{{ whisper.retention|map('join', ':')|join(',') }}" - name: Configure retention for collectd stats template: