tripleo-validations/validations/ceilometerdb-size.yaml

52 lines
1.5 KiB
YAML

---
- hosts: undercloud
vars:
metadata:
name: Events Database Size Check
description: >
The undercloud's events database can grow to a substantial
size if event_time_to_live is set to a negative value (infinite limit).
This validation checks event_time_to_live and fails if the variable is
set to a negative value or if it has no custom setting
(their value is -1 by default).
groups:
- pre-deployment
event_ttl_check: "event_time_to_live"
panko_config_file: "/var/lib/config-data/puppet-generated/panko/etc/panko/panko.conf"
tasks:
- include_tasks: tasks/deprecation.yaml
- name: Get the path of tripleo undercloud config file
become: true
hiera:
name: "tripleo_undercloud_conf_file"
- name: Check if telemetry services are enabled
ini:
path: "{{ tripleo_undercloud_conf_file }}"
section: DEFAULT
key: enable_telemetry
register: enable_telemetry
become: true
- name: End play if telemetry is not enabled
meta: end_play
when: not enable_telemetry.value|bool
- name: Get event ttl from panko configuration file
become: true
ini:
path: "{{ panko_config_file }}"
section: database
key: "{{ event_ttl_check }}"
ignore_missing_file: true
register: event_check_result
- name: Fail if event_ttl_check is set to -1
fail:
msg: >-
'{{ panko_config_file }}[database]/{{ event_ttl_check }}' is
set to -1 or not set
when: event_check_result.value|int|default(-1) < 0