Merge "Add feature to support managing dynamic pollsters"

This commit is contained in:
Zuul 2020-04-29 17:45:34 +00:00 committed by Gerrit Code Review
commit 70e7b1b0d8
4 changed files with 55 additions and 3 deletions

View File

@ -100,12 +100,9 @@ ceilometer_ipmi_extra_volumes: "{{ ceilometer_extra_volumes }}"
# OpenStack
####################
ceilometer_logging_debug: "{{ openstack_logging_debug }}"
ceilometer_keystone_user: "ceilometer"
openstack_ceilometer_auth: "{{ openstack_auth }}"
####################
# Kolla
####################
@ -115,6 +112,7 @@ ceilometer_dev_mode: "{{ kolla_dev_mode }}"
ceilometer_source_version: "{{ kolla_source_version }}"
ceilometer_custom_meters_local_folder: "meters.d"
ceilometer_dynamic_pollsters_local_folder: "pollsters.d"
####################
# Keystone

View File

@ -63,6 +63,46 @@
notify:
- "Restart {{ item.key }} container"
- name: Check if the folder ["{{ node_custom_config }}/ceilometer/{{ ceilometer_dynamic_pollsters_local_folder }}"] for dynamic pollsters definitions exist
stat:
path: "{{ node_custom_config }}/ceilometer/{{ ceilometer_dynamic_pollsters_local_folder }}"
delegate_to: localhost
register: ceilometer_dynamic_pollsters_folder
run_once: True
- name: Set the variable that control the copy of dynamic pollsters definitions
set_fact:
should_copy_dynamic_pollster_definitions: "{{ ceilometer_dynamic_pollsters_folder.stat.exists and ceilometer_dynamic_pollsters_folder.stat.isdir }}"
- name: Clean default folder for dynamic pollsters definitions
file:
state: absent
path: "{{ node_config_directory }}/ceilometer-central/pollsters.d/"
- name: Create default folder for dynamic pollsters definitions
file:
path: "{{ node_config_directory }}/ceilometer-central/pollsters.d"
state: "directory"
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
become: true
when:
- should_copy_dynamic_pollster_definitions
- inventory_hostname in groups['ceilometer-central']
- name: Copying dynamic pollsters definitions
copy:
src: "{{ node_custom_config }}/ceilometer/{{ ceilometer_dynamic_pollsters_local_folder }}/"
dest: "{{ node_config_directory }}/ceilometer-central/pollsters.d/"
mode: "0660"
become: true
when:
- should_copy_dynamic_pollster_definitions
- inventory_hostname in groups['ceilometer-central']
notify:
- "Restart ceilometer-central container"
- name: Check if custom polling.yaml exists
stat:
path: "{{ node_custom_config }}/ceilometer/polling.yaml"

View File

@ -30,6 +30,12 @@
"dest": "/etc/ceilometer/meters.d",
"owner": "ceilometer",
"perm": "0700"
}{% endif %}{% if should_copy_dynamic_pollster_definitions %},
{
"source": "{{ container_config_directory }}/{{ ceilometer_dynamic_pollsters_local_folder }}",
"dest": "/etc/ceilometer/pollsters.d",
"owner": "ceilometer",
"perm": "0700"
}{% endif %},
{
"source": "{{ container_config_directory }}/pipeline.yaml",

View File

@ -0,0 +1,8 @@
---
features:
- |
Add support for managing Ceilometer dynamic pollster configuration in
Kolla-ansible. This feature will look for configurations in
``{{ node_custom_config }}/ceilometer/pollster.d/`` by default.
If there are configs there, they are copied to the control nodes,
to configure Ceilometer dynamic pollster sub-system.