Add feature to support managing dynamic pollsters

Depends-On: https://review.opendev.org/#/c/677031/
Change-Id: I273aa795cf5c92f344accae2c219dbb51d318b59
This commit is contained in:
Rafael Weingärtner 2019-08-29 23:02:05 -03:00
parent e04d03e764
commit 11d1412c6b
4 changed files with 55 additions and 3 deletions

View File

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

View File

@ -63,6 +63,46 @@
notify: notify:
- "Restart {{ item.key }} container" - "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 - name: Check if custom polling.yaml exists
stat: stat:
path: "{{ node_custom_config }}/ceilometer/polling.yaml" path: "{{ node_custom_config }}/ceilometer/polling.yaml"

View File

@ -30,6 +30,12 @@
"dest": "/etc/ceilometer/meters.d", "dest": "/etc/ceilometer/meters.d",
"owner": "ceilometer", "owner": "ceilometer",
"perm": "0700" "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 %}, }{% endif %},
{ {
"source": "{{ container_config_directory }}/pipeline.yaml", "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.