diff --git a/ansible/roles/ceilometer/tasks/config.yml b/ansible/roles/ceilometer/tasks/config.yml index a4b46e96fd4b56810146b9e70872c92128ae466c..2835ec4be2703201d98df1ab83d9edd887255112 100644 --- a/ansible/roles/ceilometer/tasks/config.yml +++ b/ansible/roles/ceilometer/tasks/config.yml @@ -252,41 +252,20 @@ notify: - Restart ceilometer-notification container -- name: Check custom event_pipeline.yaml exists - stat: - path: "{{ node_custom_config }}/ceilometer/event_pipeline.yaml" - delegate_to: localhost - register: ceilometer_event_pipeline_file - - name: Copying over event_pipeline.yaml vars: service: "{{ ceilometer_services['ceilometer-notification'] }}" - copy: - src: "{{ node_custom_config }}/ceilometer/event_pipeline.yaml" - dest: "{{ node_config_directory }}/ceilometer-notification/event_pipeline.yaml" - force: True - mode: "0660" - become: true - register: ceilometer_event_pipeline_overwriting - when: - - ceilometer_event_pipeline_file.stat.exists - - inventory_hostname in groups[service.group] - - service.enabled | bool - notify: - - Restart ceilometer-notification container - -- name: Copying over event_pipeline.yaml for notification service - vars: - service: "{{ ceilometer_services['ceilometer-notification'] }}" - template: - src: "event_pipeline.yaml.j2" + merge_yaml: + sources: + - "{{ role_path }}/templates/event_pipeline.yaml.j2" + - "{{ node_custom_config }}/ceilometer/event_pipeline.yaml" + - "{{ node_custom_config }}/ceilometer/{{ inventory_hostname }}/event_pipeline.yaml" dest: "{{ node_config_directory }}/ceilometer-notification/event_pipeline.yaml" mode: "0660" become: true when: - inventory_hostname in groups[service.group] - service.enabled | bool - - not ceilometer_event_pipeline_file.stat.exists notify: - Restart ceilometer-notification container diff --git a/releasenotes/notes/ceilometer-merge-yaml-event-pipeline-bee198be62ebd6a9.yaml b/releasenotes/notes/ceilometer-merge-yaml-event-pipeline-bee198be62ebd6a9.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2d0f0505c5612870668e2d6441f2213a7840d2af --- /dev/null +++ b/releasenotes/notes/ceilometer-merge-yaml-event-pipeline-bee198be62ebd6a9.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + A custom ``event_pipeline.yaml`` file for the Ceilometer notification + service is now processed with ``merge_yaml``. This allows Jinja2 to be + used. Furthermore, it is possible to have a global + ``event_pipeline.yaml`` and host-specific ``event_pipeline.yaml`` + files.