bb8d3bcedbeef3e3e3e482439983bd9b589b3157
[apex-tripleo-heat-templates.git] / puppet / services / gnocchi-statsd.yaml
1 heat_template_version: ocata
2
3 description: >
4   Gnocchi service configured with Puppet
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   EndpointMap:
17     default: {}
18     description: Mapping of service endpoint -> protocol. Typically set
19                  via parameter_defaults in the resource registry.
20     type: json
21   MonitoringSubscriptionGnocchiStatsd:
22     default: 'overcloud-gnocchi-statsd'
23     type: string
24
25 resources:
26   GnocchiServiceBase:
27     type: ./gnocchi-base.yaml
28     properties:
29       ServiceNetMap: {get_param: ServiceNetMap}
30       DefaultPasswords: {get_param: DefaultPasswords}
31       EndpointMap: {get_param: EndpointMap}
32
33 outputs:
34   role_data:
35     description: Role data for the Gnocchi role.
36     value:
37       service_name: gnocchi_statsd
38       monitoring_subscription: {get_param: MonitoringSubscriptionGnocchiStatsd}
39       config_settings:
40         map_merge:
41           - get_attr: [GnocchiServiceBase, role_data, config_settings]
42           - tripleo.gnocchi_statsd.firewall_rules:
43               '140 gnocchi-statsd':
44                 dport: 8125
45                 proto: 'udp'
46       step_config: |
47         include ::tripleo::profile::base::gnocchi::statsd
48       upgrade_tasks:
49         - name: Check if gnocchi_statsd is deployed
50           command: systemctl is-enabled openstack-gnocchi-statsd
51           tags: common
52           ignore_errors: True
53           register: gnocchi_statsd_enabled
54         - name: "PreUpgrade step0,validation: Check service openstack-gnocchi-statsd is running"
55           shell: /usr/bin/systemctl show 'openstack-gnocchi-statsd' --property ActiveState | grep '\bactive\b'
56           when: gnocchi_statsd_enabled.rc == 0
57           tags: step0,validation
58         - name: Stop gnocchi_statsd service
59           tags: step1
60           when: gnocchi_statsd_enabled.rc == 0
61           service: name=openstack-gnocchi-statsd state=stopped