tripleo-heat-templates/puppet/services/ceilometer-collector.yaml
Saravanan KR a096ddab34 Add role specific information to the service template
When a service is enabled on multiple roles, the parameters for the
service will be global. This change enables an option to provide
role specific parameter to services and other templates.

Two new parameters - RoleName and RoleParameters, are added to the
service template. RoleName provides the role name of on which the
current instance of the service is being applied on. RoleParameters
provides the list of parameters which are configured specific to the
role in the environment file, like below:

  parameters_default:
      # Default value for applied to all roles
      NovaReservedHostMemory: 2048
      ComputeDpdkParameters:
          # Applied only to ComputeDpdk role
          NovaReservedHostMemory: 4096

In above sample, the cluster contains 2 roles - Compute, ComputeDpdk.
The values of ComputeDpdkParameters will be passed on to the templates
as RoleParameters while creating the stack for ComputeDpdk role. The
parameter which supports role specific configuration, should find the
parameter first in in the RoleParameters list, if not found, then the
default (for all roles) should be used.
Implements: blueprint tripleo-derive-parameters

Change-Id: I72376a803ec6b2ed93903cc0c95a6ffce718b6dc
2017-05-15 10:06:46 +05:30

141 lines
5.5 KiB
YAML

heat_template_version: pike
description: >
OpenStack Ceilometer Collector service configured with Puppet
This service is deprecated and will be removed in future releases.
parameters:
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
CeilometerBackend:
default: 'mongodb'
description: The ceilometer backend type.
type: string
CeilometerPassword:
description: The password for the ceilometer service account.
type: string
hidden: true
MonitoringSubscriptionCeilometerCollector:
default: 'overcloud-ceilometer-collector'
type: string
CeilometerCollectorLoggingSource:
type: json
default:
tag: openstack.ceilometer.collector
path: /var/log/ceilometer/collector.log
CeilometerMeterDispatcher:
default: ['gnocchi']
description: Comma-seperated list of Dispatcher to process meter data
Note that database option is deprecated and will not be
supported in future.
type: comma_delimited_list
constraints:
- allowed_values: ['gnocchi', 'database']
CeilometerEventDispatcher:
default: ['panko', 'gnocchi']
description: Comma-separated list of Dispatchers to process events data
Note that database option is deprecated and will not be
supported in future.
type: comma_delimited_list
constraints:
- allowed_values: ['panko', 'gnocchi', 'database']
CeilometerEventTTL:
default: '86400'
description: Number of seconds that events are kept in the database for
(<= 0 means forever)
type: string
CeilometerMeteringTTL:
default: '86400'
description: Number of seconds that samples are kept in the database for
(<= 0 means forever)
type: string
resources:
CeilometerServiceBase:
type: ./ceilometer-base.yaml
properties:
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
MongoDbBase:
type: ./database/mongodb-base.yaml
properties:
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
outputs:
role_data:
description: Role data for the Ceilometer Collector role.
value:
service_name: ceilometer_collector
monitoring_subscription: {get_param: MonitoringSubscriptionCeilometerCollector}
logging_source: {get_param: CeilometerCollectorLoggingSource}
logging_groups:
- ceilometer
config_settings:
map_merge:
- get_attr: [MongoDbBase, role_data, config_settings]
- get_attr: [CeilometerServiceBase, role_data, config_settings]
- ceilometer::db::database_connection:
make_url:
scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
username: ceilometer
password: {get_param: CeilometerPassword}
host: {get_param: [EndpointMap, MysqlInternal, host]}
path: /ceilometer
query:
read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
ceilometer_backend: {get_param: CeilometerBackend}
ceilometer::event_time_to_live: {get_param: CeilometerEventTTL}
ceilometer::metering_time_to_live: {get_param: CeilometerMeteringTTL}
# we include db_sync class in puppet-tripleo
ceilometer::db::sync_db: false
ceilometer::db::database_db_max_retries: -1
ceilometer::db::database_max_retries: -1
ceilometer::collector::meter_dispatcher: {get_param: CeilometerMeterDispatcher}
ceilometer::collector::event_dispatcher: {get_param: CeilometerEventDispatcher}
service_config_settings:
get_attr: [CeilometerServiceBase, role_data, service_config_settings]
step_config: |
include ::tripleo::profile::base::ceilometer::collector
upgrade_tasks:
- name: Check if ceilometer_collector is deployed
command: systemctl is-enabled openstack-ceilometer-collector
tags: common
ignore_errors: True
register: ceilometer_collector_enabled
- name: "PreUpgrade step0,validation: Check service openstack-ceilometer-collector is running"
shell: /usr/bin/systemctl show 'openstack-ceilometer-collector' --property ActiveState | grep '\bactive\b'
when: ceilometer_collector_enabled.rc == 0
tags: step0,validation
- name: Stop ceilometer_collector service
tags: step1
when: ceilometer_collector_enabled.rc == 0
service: name=openstack-ceilometer-collector state=stopped