/home/zuul/src/opendev.org/openstack/openstack-ansible-os_ceilometer/vars/main.yml
---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# These vars find a file on the deployment node, if it exists - otherwise the result is empty.
ceilometer_data_meters_user_content: "{{ lookup('pipe', 'cat ' ~ ceilometer_data_meters_default_file_path ~ ' 2>/dev/null || true') }}"
ceilometer_event_definitions_user_content: "{{ lookup('pipe', 'cat ' ~ ceilometer_event_definitions_default_file_path ~ ' 2>/dev/null || true') }}"
ceilometer_gnocchi_resources_user_content: "{{ lookup('pipe', 'cat ' ~ ceilometer_gnocchi_resources_default_file_path ~ ' 2>/dev/null || true') }}"
ceilometer_loadbalancer_v2_meter_definitions_user_content: "{{ lookup('pipe', 'cat ' ~ ceilometer_loadbalancer_v2_meter_definitions_default_file_path ~ ' 2>/dev/null || true') }}"
ceilometer_osprofiler_event_definitions_user_content: "{{ lookup('pipe', 'cat ' ~ ceilometer_osprofiler_event_definitions_default_file_path ~ ' 2>/dev/null || true') }}"
ceilometer_polling_user_content: "{{ lookup('pipe', 'cat ' ~ ceilometer_polling_default_file_path ~ ' 2>/dev/null || true') }}"

_ceilometer_rootwrap_conf_overrides:
  DEFAULT:
    filters_path: "/etc/ceilometer/rootwrap.d,/usr/share/ceilometer/rootwrap"
    exec_dirs: "{{ ceilometer_bin }},/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin"

ceilometer_core_files:
  - tmp_f: "/tmp/rootwrap.conf"
    source_f: "/etc/ceilometer/rootwrap.conf"
    config_overrides: "{{ _ceilometer_rootwrap_conf_overrides | combine(ceilometer_rootwrap_conf_overrides, recursive=True) }}"
    config_type: "ini"
    owner: "root"
    group: "{{ ceilometer_system_group_name }}"
    mode: "0640"
  - tmp_f: "/tmp/polling.yaml"
    source_f: "/etc/ceilometer/polling.yaml"
    config_overrides: "{{ ceilometer_polling_yaml_overrides }}"
    config_type: "yaml"
    list_extend: false
    content: "{{ ceilometer_polling_user_content }}"
  - tmp_f: "/tmp/loadbalancer_v2_meter_definitions.yaml"
    source_f: "/etc/ceilometer/examples/loadbalancer_v2_meter_definitions.yaml"
    target_f: "/etc/ceilometer/loadbalancer_v2_meter_definitions.yaml"
    config_overrides: "{{ ceilometer_loadbalancer_v2_meter_definitions_yaml_overrides }}"
    config_type: "yaml"
    list_extend: false
    content: "{{ ceilometer_loadbalancer_v2_meter_definitions_user_content }}"
    condition: "{{ ceilometer_install_method == 'source' }}"
  - tmp_f: "/tmp/osprofiler_event_definitions.yaml"
    source_f: "/etc/ceilometer/examples/osprofiler_event_definitions.yaml"
    target_f: "/etc/ceilometer/osprofiler_event_definitions.yaml"
    config_overrides: "{{ ceilometer_osprofiler_event_definitions_yaml_overrides }}"
    config_type: "yaml"
    list_extend: false
    content: "{{ ceilometer_osprofiler_event_definitions_user_content }}"
    condition: "{{ ceilometer_install_method == 'source' }}"
  - tmp_f: "/tmp/meters.yaml"
    source_f: "{{ ceilometer_lib_dir }}/ceilometer/data/meters.d/meters.yaml"
    config_overrides: "{{ ceilometer_data_meters_yaml_overrides }}"
    config_type: "yaml"
    list_extend: false
    content: "{{ ceilometer_data_meters_user_content }}"
  - tmp_f: "/tmp/event_definitions.yaml"
    source_f: "{{ ceilometer_lib_dir }}/ceilometer/pipeline/data/event_definitions.yaml"
    config_overrides: "{{ ceilometer_event_definitions_yaml_overrides }}"
    config_type: "yaml"
    list_extend: false
    content: "{{ ceilometer_event_definitions_user_content }}"
  - tmp_f: "/tmp/gnocchi_resources.yaml"
    source_f: "{{ ceilometer_lib_dir }}/ceilometer/publisher/data/gnocchi_resources.yaml"
    config_overrides: "{{ ceilometer_gnocchi_resources_yaml_overrides }}"
    config_type: "yaml"
    list_extend: false
    content: "{{ ceilometer_gnocchi_resources_user_content }}"