Merge "Sort ResourceGroup resource list"
[apex-tripleo-heat-templates.git] / puppet / services / monitoring / sensu-client.yaml
1 heat_template_version: ocata
2
3 description: Sensu client configured with Puppet
4
5 parameters:
6   ServiceNetMap:
7     default: {}
8     description: Mapping of service_name -> network name. Typically set
9                  via parameter_defaults in the resource registry.  This
10                  mapping overrides those in ServiceNetMapDefaults.
11     type: json
12   DefaultPasswords:
13     default: {}
14     type: json
15   EndpointMap:
16     default: {}
17     description: >
18       Mapping of service endpoint -> protocol. Typically set
19       via parameter_defaults in the resource registry.
20     type: json
21   AdminPassword:
22     description: Keystone admin user password
23     type: string
24   KeystoneRegion:
25     default: 'regionOne'
26     description: Keystone region for endpoint
27     type: string
28   SensuClientCustomConfig:
29     default: {}
30     description: Hash containing custom sensu-client variables.
31     type: json
32     label: Custom configuration for Sensu Client variables
33
34 resources:
35   SensuBase:
36     type: ./sensu-base.yaml
37     properties:
38       ServiceNetMap: {get_param: ServiceNetMap}
39       DefaultPasswords: {get_param: DefaultPasswords}
40       EndpointMap: {get_param: EndpointMap}
41
42 outputs:
43   role_data:
44     description: Role data for the Sensu client role.
45     value:
46       service_name: sensu_client
47       monitoring_subscription: all
48       config_settings:
49         map_merge:
50           - get_attr: [SensuBase, role_data, config_settings]
51           - sensu::api: false
52             sensu::client: true
53             sensu::server: false
54             sensu::client_custom:
55               map_merge:
56                 - {get_param: SensuClientCustomConfig}
57                 - openstack:
58                     username: 'admin'
59                     password: {get_param: AdminPassword}
60                     auth_url: {get_param: [EndpointMap, KeystoneInternal, uri]}
61                     tenant_name: 'admin'
62                     region: {get_param: KeystoneRegion}
63       step_config: |
64         include ::tripleo::profile::base::monitoring::sensu
65       upgrade_tasks:
66         - name: Check if sensu_client is deployed
67           command: systemctl is-enabled sensu-client
68           tags: common
69           ignore_errors: True
70           register: sensu_client_enabled
71         - name: Check status of sensu-client service
72           shell: >
73             /usr/bin/systemctl show sensu-client --property ActiveState |
74             grep '\bactive\b'
75           when: sensu_client_enabled.rc == 0
76           tags: step0,validation
77         - name: Stop sensu-client service
78           tags: step1
79           when: sensu_client_enabled.rc == 0
80           service: name=sensu-client state=stopped
81         - name: Install sensu package if it was disabled
82           tags: step3
83           yum: name=sensu state=latest
84           when: sensu_client.rc != 0