Merge "Add support for Ceilometer custom polling.yaml"

This commit is contained in:
Zuul 2018-06-10 00:20:22 +00:00 committed by Gerrit Code Review
commit c7c804414b
5 changed files with 50 additions and 3 deletions

View File

@ -7,6 +7,7 @@
ceilometer_conf: "{{ ceilometer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
ceilometer_pipeline: "{{ ceilometer_pipelines.results|selectattr('item.key', 'equalto', service_name)|first }}"
policy_overwriting: "{{ ceilometer_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
polling_overwriting: "{{ ceilometer_polling_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
ceilometer_notification_container: "{{ check_ceilometer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
panko_conf: "{{ panko_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
become: true
@ -36,6 +37,7 @@
ceilometer_conf: "{{ ceilometer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
ceilometer_pipeline: "{{ ceilometer_pipelines.results|selectattr('item.key', 'equalto', service_name)|first }}"
policy_overwriting: "{{ ceilometer_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
polling_overwriting: "{{ ceilometer_polling_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
ceilometer_central_container: "{{ check_ceilometer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
become: true
kolla_docker:
@ -62,6 +64,7 @@
ceilometer_conf: "{{ ceilometer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
ceilometer_pipeline: "{{ ceilometer_pipelines.results|selectattr('item.key', 'equalto', service_name)|first }}"
policy_overwriting: "{{ ceilometer_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
polling_overwriting: "{{ ceilometer_polling_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
ceilometer_compute_container: "{{ check_ceilometer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
become: true
kolla_docker:

View File

@ -12,6 +12,32 @@
- item.value.enabled | bool
with_dict: "{{ ceilometer_services }}"
- name: Check custom polling.yaml exists
local_action: stat path="{{ node_custom_config }}/ceilometer/polling.yaml"
register: ceilometer_polling_file
- name: Copying over polling.yaml
copy:
src: "{{ node_custom_config }}/ceilometer/polling.yaml"
dest: "{{ node_config_directory }}/{{ item.key }}/polling.yaml"
force: True
mode: "0600"
become: true
register: ceilometer_polling_overwriting
when:
- ceilometer_polling_file.stat.exists
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ceilometer_services }}"
notify:
- "Restart {{ item.key }} container"
- name: Set ceilometer polling file's path
set_fact:
ceilometer_polling_file_path: "{{ ceilometer_polling_file.stat.path }}"
when:
- ceilometer_polling_file.stat.exists
- name: Check if policies shall be overwritten
local_action: stat path="{{ item }}"
run_once: True

View File

@ -6,7 +6,13 @@
"dest": "/etc/ceilometer/ceilometer.conf",
"owner": "ceilometer",
"perm": "0600"
}{% if ceilometer_policy_file is defined %},
}{% if ceilometer_polling_file_path is defined %},
{
"source": "{{ container_config_directory }}/polling.yaml",
"dest": "/etc/ceilometer/polling.yaml",
"owner": "ceilometer",
"perm": "0600"
}{% endif %}{% if ceilometer_policy_file is defined %},
{
"source": "{{ container_config_directory }}/{{ ceilometer_policy_file }}",
"dest": "/etc/ceilometer/{{ ceilometer_policy_file }}",

View File

@ -6,7 +6,13 @@
"dest": "/etc/ceilometer/ceilometer.conf",
"owner": "ceilometer",
"perm": "0600"
}{% if ceilometer_policy_file is defined %},
}{% if ceilometer_polling_file_path is defined %},
{
"source": "{{ container_config_directory }}/polling.yaml",
"dest": "/etc/ceilometer/polling.yaml",
"owner": "ceilometer",
"perm": "0600"
}{% endif %}{% if ceilometer_policy_file is defined %},
{
"source": "{{ container_config_directory }}/{{ ceilometer_policy_file }}",
"dest": "/etc/ceilometer/{{ ceilometer_policy_file }}",

View File

@ -24,7 +24,13 @@
"dest": "/etc/ceilometer/pipeline.yaml",
"owner": "ceilometer",
"perm": "0600"
}{% if ceilometer_policy_file is defined %},
}{% if ceilometer_polling_file_path is defined %},
{
"source": "{{ container_config_directory }}/polling.yaml",
"dest": "/etc/ceilometer/polling.yaml",
"owner": "ceilometer",
"perm": "0600"
}{% endif %}{% if ceilometer_policy_file is defined %},
{
"source": "{{ container_config_directory }}/{{ ceilometer_policy_file }}",
"dest": "/etc/ceilometer/{{ ceilometer_policy_file }}",