From 948e59c0d789258d7a3489410620acf3c92d8163 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 13 Jul 2017 12:21:09 -0600 Subject: [PATCH] Make whisper retention settings configurable The first value must be '10s', still, for consistency with collectd Signed-off-by: Zack Cerza --- ansible/roles/ceph-grafana/defaults/main.yml | 5 +++++ ansible/roles/ceph-grafana/tasks/configure_carbon.yml | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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: -- 2.47.3