summaryrefslogtreecommitdiffstats
path: root/puppet/services/ceilometer-collector.yaml
blob: 111b3e8b46b95ece47515b66b06856f71b8b9507 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
heat_template_version: ocata

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
  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}

  MongoDbBase:
    type: ./database/mongodb-base.yaml
    properties:
      ServiceNetMap: {get_param: ServiceNetMap}
      DefaultPasswords: {get_param: DefaultPasswords}
      EndpointMap: {get_param: EndpointMap}

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:
              list_join:
                - ''
                - - {get_param: [EndpointMap, MysqlInternal, protocol]}
                - - '://ceilometer:'
                  - {get_param: CeilometerPassword}
                  - '@'
                  - {get_param: [EndpointMap, MysqlInternal, host]}
                  - '/ceilometer'
                  - '?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