]> git-server-git.apps.pok.os.sepia.ceph.com Git - cephmetrics.git/commitdiff
Make whisper retention settings configurable
authorZack Cerza <zack@redhat.com>
Thu, 13 Jul 2017 18:21:09 +0000 (12:21 -0600)
committerZack Cerza <zack@redhat.com>
Thu, 13 Jul 2017 22:24:42 +0000 (16:24 -0600)
The first value must be '10s', still, for consistency with collectd

Signed-off-by: Zack Cerza <zack@redhat.com>
ansible/roles/ceph-grafana/defaults/main.yml
ansible/roles/ceph-grafana/tasks/configure_carbon.yml

index 0668af77a81a7f2175e138d066c83122484745c9..48caca26b2869f03a4560fb257e4be343246d174 100644 (file)
@@ -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
index cb6b728b1f70365ae4f3f81a1ccd726acef32707..1f361857aa8abca144d3f4df9507e0645f22ca87 100644 (file)
@@ -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: