diff --git a/ansible/roles/ceilometer/handlers/main.yml b/ansible/roles/ceilometer/handlers/main.yml index 3be79f2e87..a5bcf9788f 100644 --- a/ansible/roles/ceilometer/handlers/main.yml +++ b/ansible/roles/ceilometer/handlers/main.yml @@ -31,6 +31,7 @@ ceilometer_conf: "{{ ceilometer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" policy_json: "{{ ceilometer_policy_jsons.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 }}" kolla_docker: action: "recreate_or_restart_container" common_options: "{{ docker_common_options }}" @@ -46,6 +47,7 @@ or policy_json.changed | bool or ceilometer_events.changed | bool or ceilometer_notification_container.changed | bool + or panko_conf.changed | bool - name: Restart ceilometer-central container vars: @@ -78,6 +80,7 @@ ceilometer_conf: "{{ ceilometer_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" policy_json: "{{ ceilometer_policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" ceilometer_collector_container: "{{ check_ceilometer_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" + panko_conf: "{{ panko_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" kolla_docker: action: "recreate_or_restart_container" common_options: "{{ docker_common_options }}" @@ -92,6 +95,7 @@ or ceilometer_conf.changed | bool or policy_json.changed | bool or ceilometer_collector_container.changed | bool + or panko_conf.changed | bool - name: Restart ceilometer-compute container vars: diff --git a/ansible/roles/ceilometer/tasks/config.yml b/ansible/roles/ceilometer/tasks/config.yml index 72e3763a23..d6276c3592 100644 --- a/ansible/roles/ceilometer/tasks/config.yml +++ b/ansible/roles/ceilometer/tasks/config.yml @@ -84,6 +84,29 @@ notify: - Restart ceilometer-notification container +- name: Copying over panko.conf + vars: + service_require_panko_conf: + - ceilometer-notification + - ceilometer-collector + merge_configs: + sources: + - ../panko/templates/panko.conf.j2 + - "{{ node_custom_config }}/global.conf" + - "{{ node_custom_config }}/panko.conf" + - "{{ node_custom_config }}/panko/panko.conf" + - "{{ node_custom_config }}/panko/{{ inventory_hostname }}/panko.conf" + dest: "{{ node_config_directory }}/panko/panko.conf" + register: panko_confs + when: + - ceilometer_event_type == 'panko' + - item.value.enabled | bool + - inventory_hostname in groups[item.value.group] + - item.key in service_require_panko_conf + with_dict: "{{ ceilometer_services }}" + notify: + - "Restart {{ item.key }} container" + - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/ceilometer/policy.json" register: ceilometer_policy diff --git a/ansible/roles/ceilometer/templates/ceilometer-collector.json.j2 b/ansible/roles/ceilometer/templates/ceilometer-collector.json.j2 index 1d46da006b..204dfc5f39 100644 --- a/ansible/roles/ceilometer/templates/ceilometer-collector.json.j2 +++ b/ansible/roles/ceilometer/templates/ceilometer-collector.json.j2 @@ -13,6 +13,13 @@ "owner": "ceilometer", "perm": "0600", "optional": true + }, + { + "source": "{{ container_config_directory }}/panko.conf", + "dest": "/etc/panko/panko.conf", + "owner": "ceilometer", + "perm": "0600", + "optional": true } ], "permissions": [ diff --git a/ansible/roles/ceilometer/templates/ceilometer-notification.json.j2 b/ansible/roles/ceilometer/templates/ceilometer-notification.json.j2 index 2ee3522721..98ccaec0b2 100644 --- a/ansible/roles/ceilometer/templates/ceilometer-notification.json.j2 +++ b/ansible/roles/ceilometer/templates/ceilometer-notification.json.j2 @@ -31,6 +31,13 @@ "owner": "ceilometer", "perm": "0600", "optional": true + }, + { + "source": "{{ container_config_directory }}/panko.conf", + "dest": "/etc/panko/panko.conf", + "owner": "ceilometer", + "perm": "0600", + "optional": true } ], "permissions": [ diff --git a/ansible/site.yml b/ansible/site.yml index bca1aafba7..77d3f2905c 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -436,6 +436,8 @@ - name: Apply role ceilometer gather_facts: false + vars_files: + - "roles/panko/defaults/main.yml" hosts: - ceilometer - compute