openstack-ansible-os_ceilom.../tasks/ceilometer_post_install.yml
Dmitriy Rabotjagov 508f077c61 Add ability to override meters.yaml and event_definitions.yaml
This change will allow deployer to override meters.yaml and
event_definitions.yaml files, if he would like to change layout/data,
which will be stored in gnocchi, and the way it will be
updated/stored.

Change-Id: I6bfe03dc1f5ad795d91534b1a51c4d8889bb3ed1
2018-12-12 19:46:39 +02:00

100 lines
4.6 KiB
YAML

---
# Copyright 2014, 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.
- name: Retrieve default configuration files
uri:
url: "{{ item }}"
return_content: yes
with_items:
- "{{ ceilometer_git_config_lookup_location }}/{{ ceilometer_data_meters_git_file_path }}"
- "{{ ceilometer_git_config_lookup_location }}/{{ ceilometer_event_definitions_git_file_path }}"
- "{{ ceilometer_git_config_lookup_location }}/{{ ceilometer_gnocchi_resources_git_file_path }}"
- "{{ ceilometer_git_config_lookup_location }}/{{ ceilometer_loadbalancer_v2_meter_definitions_git_file_path }}"
- "{{ ceilometer_git_config_lookup_location }}/{{ ceilometer_osprofiler_event_definitions_git_file_path }}"
- "{{ ceilometer_git_config_lookup_location }}/{{ ceilometer_polling_git_file_path }}"
register: _git_file_fetch
- name: Copy ceilometer configuration files
config_template:
content: "{{ item.content | default(omit) }}"
src: "{{ item.src | default(omit) }}"
dest: "{{ item.dest }}"
owner: "{{ item.owner | default(ceilometer_system_user_name) }}"
group: "{{ item.group | default(ceilometer_system_group_name) }}"
mode: "{{ item.mode | default('0644') }}"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
list_extend: "{{ item.list_extend | default(omit) }}"
with_items:
- src: "ceilometer.conf.j2"
dest: "/etc/ceilometer/ceilometer.conf"
config_overrides: "{{ ceilometer_ceilometer_conf_overrides }}"
config_type: "ini"
- src: "pipeline.yaml.j2"
dest: "/etc/ceilometer/pipeline.yaml"
config_overrides: "{{ ceilometer_pipeline_yaml_overrides }}"
config_type: "yaml"
list_extend: false
- src: "rootwrap.conf.j2"
dest: "/etc/ceilometer/rootwrap.conf"
owner: "root"
group: "root"
config_overrides: "{{ ceilometer_rootwrap_conf_overrides }}"
config_type: "ini"
- dest: "/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 | default(ceilometer_loadbalancer_v2_meter_definitions_default_content, true) }}"
- dest: "/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 | default(ceilometer_osprofiler_event_definitions_default_content, true) }}"
- dest: "/etc/ceilometer/polling.yaml"
config_overrides: "{{ ceilometer_polling_yaml_overrides }}"
config_type: "yaml"
list_extend: false
content: "{{ ceilometer_polling_user_content | default(ceilometer_polling_default_content, true) }}"
- dest: "{{ 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 | default(ceilometer_data_meters_default_content, true) }}"
- dest: "{{ 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 | default(ceilometer_event_definitions_default_content, true) }}"
- dest: "{{ 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 | default(ceilometer_gnocchi_resources_default_content, true) }}"
notify:
- Restart ceilometer services
- name: Copy rootwrap filters
copy:
src: "{{ item }}"
dest: "/etc/ceilometer/rootwrap.d/"
owner: "root"
group: "root"
with_fileglob:
- rootwrap.d/*
notify:
- Restart ceilometer services