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