ceilometerdb-size.yaml: Fix ceilometer database validation

- now fails even if values are not set (they are -1 by default)
- since the limit is infinite for all negative values, validation
  does not only check -1, but passes only for custom values >= 0

Change-Id: I927e1b1296f3d89ac087916d8e4adc184185bcc5
Closes-Bug: #1643813
This commit is contained in:
Katerina Pilatova 2016-12-02 12:32:55 +01:00
parent 9317394b4e
commit 6302189072
1 changed files with 12 additions and 6 deletions

View File

@ -4,20 +4,26 @@
metadata:
name: Ceilometer Database Size Check
description: >
The undercloud's ceilometer database can grow to a substantial size
if metering_time_to_live and event_time_to_live is set to -1 (infinite).
We check each setting and fail if -1 is set.
The undercloud's ceilometer database can grow to a substantial
size if metering_time_to_live and event_time_to_live is set to
a negative value (infinite limit).
This validation checks each setting and fails if variables are
set to a negative value or if they have no custom setting
(their value is -1 by default).
groups:
- pre-deployment
ttl_value: "-1"
metering_ttl_check: "metering_time_to_live"
event_ttl_check: "event_time_to_live"
tasks:
- name: Check ceilomter.conf for a -1 TTL setting
- name: Get TTL setting values from ceilometer.conf
become: true
ini: path=/etc/ceilometer/ceilometer.conf section=database key={{ item }} ignore_missing_file=True
register: config_result
with_items:
- "{{ metering_ttl_check }}"
- "{{ event_ttl_check }}"
failed_when: "ttl_value == config_result.value"
- name: Check values
fail: msg="Value of {{ item.item }} is set to {{ item.value or "-1" }}."
when: item.value|int < 0 or item.value == None
with_items: "{{ config_result.results }}"