Merge "FQDN validation"
[apex-tripleo-heat-templates.git] / puppet / services / gnocchi-metricd.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   MonitoringSubscriptionGnocchiMetricd:
22     default: 'overcloud-gnocchi-metricd'
23     type: string
24   GnocchiMetricdWorkers:
25     default: '%{::os_workers}'
26     description: Number of workers for Gnocchi MetricD
27     type: string
28
29 resources:
30   GnocchiServiceBase:
31     type: ./gnocchi-base.yaml
32     properties:
33       ServiceNetMap: {get_param: ServiceNetMap}
34       DefaultPasswords: {get_param: DefaultPasswords}
35       EndpointMap: {get_param: EndpointMap}
36
37 outputs:
38   role_data:
39     description: Role data for the Gnocchi role.
40     value:
41       service_name: gnocchi_metricd
42       monitoring_subscription: {get_param: MonitoringSubscriptionGnocchiMetricd}
43       config_settings:
44         map_merge:
45           - get_attr: [GnocchiServiceBase, role_data, config_settings]
46           - gnocchi::metricd::workers: {get_param: GnocchiMetricdWorkers}
47       step_config: |
48         include ::tripleo::profile::base::gnocchi::metricd
49       upgrade_tasks:
50         - name: Check if gnocchi_metricd is deployed
51           command: systemctl is-enabled openstack-gnocchi-metricd
52           tags: common
53           ignore_errors: True
54           register: gnocchi_metricd_enabled
55         - name: "PreUpgrade step0,validation: Check service openstack-gnocchi-metricd is running"
56           shell: /usr/bin/systemctl show 'openstack-gnocchi-metricd' --property ActiveState | grep '\bactive\b'
57           when: gnocchi_metricd_enabled.rc == 0
58           tags: step0,validation
59         - name: Stop gnocchi_metricd service
60           tags: step1
61           when: gnocchi_metricd_enabled.rc == 0
62           service: name=openstack-gnocchi-metricd state=stopped