Merge "Run Zaqar with httpd in puppet service"
[apex-tripleo-heat-templates.git] / puppet / services / metrics / collectd.yaml
1 heat_template_version: ocata
2
3 description: Collectd client service
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   EndpointMap:
13     default: {}
14     description: Mapping of service endpoint -> protocol. Typically set
15                  via parameter_defaults in the resource registry.
16     type: json
17   DefaultPasswords:
18     default: {}
19     type: json
20   CollectdDefaultPlugins:
21     default:
22       - disk
23       - interface
24       - load
25       - memory
26       - processes
27       - tcpconns
28     type: comma_delimited_list
29     description: >
30       List of collectd plugins to activate on all overcloud hosts.  See
31       the documentation for the puppet-collectd module for a list plugins
32       supported by the module (https://github.com/voxpupuli/puppet-collectd).
33       Set this key to override the default list of plugins.  Use
34       CollectdExtraPlugins if you want to load additional plugins without
35       overriding the defaults.
36   CollectdExtraPlugins:
37     default: []
38     type: comma_delimited_list
39     description: >
40       List of collectd plugins to activate on all overcloud hosts.  See
41       the documentation for the puppet-collectd module for a list plugins
42       supported by the module (https://github.com/voxpupuli/puppet-collectd).
43       Set this key to load plugins in addition to those in
44       CollectdDefaultPlugins.
45   CollectdServer:
46     type: string
47     description: >
48       Address of remote collectd server to which we will send
49       metrics.
50     default: ''
51   CollectdServerPort:
52     type: number
53     default: 25826
54     description: >
55       Port on remote collectd server to which we will send
56       metrics.
57   CollectdUsername:
58     type: string
59     description: >
60       Username for authenticating to the remote collectd server. The default
61       is to not configure any authentication.
62     default: ''
63   CollectdPassword:
64     type: string
65     hidden: true
66     description: >
67       Password for authenticating to the remote collectd server. The
68       default is to not configure any authentication.
69     default: ''
70   CollectdSecurityLevel:
71     type: string
72     description: >
73       Security level setting for remote collectd connection. If it is
74       set to Sign or Encrypt the CollectdPassword and CollectdUsername
75       parameters need to be set.
76     default: 'None'
77     constraints:
78       - allowed_values:
79           - None
80           - Sign
81           - Encrypt
82
83 outputs:
84   role_data:
85     description: Role data for the Collectd client role.
86     value:
87       service_name: collectd
88       config_settings:
89         collectd::manage_repo: false
90         collectd::purge: true
91         collectd::recurse: true
92         collectd::purge_config: true
93         collectd::minimum_version: "5.7"
94         tripleo::profile::base::metrics::collectd::collectd_server:
95           get_param: CollectdServer
96         tripleo::profile::base::metrics::collectd::collectd_port:
97           get_param: CollectdServerPort
98         tripleo::profile::base::metrics::collectd::collectd_username:
99           get_param: CollectdUsername
100         tripleo::profile::base::metrics::collectd::collectd_password:
101           get_param: CollectdPassword
102         tripleo::profile::base::metrics::collectd::collectd_securitylevel:
103           get_param: CollectdSecurityLevel
104         tripleo.collectd.plugins.collectd:
105           yaql:
106             data:
107               default_plugins: {get_param: CollectdDefaultPlugins}
108               extra_plugins: {get_param: CollectdExtraPlugins}
109             expression: >
110               ($.data.default_plugins + $.data.extra_plugins)
111               .flatten().distinct()
112       step_config: |
113         include ::tripleo::profile::base::metrics::collectd
114       upgrade_tasks:
115         - name: Check if collectd is deployed
116           command: systemctl is-enabled collectd
117           tags: common
118           ignore_errors: True
119           register: collectd_enabled
120         - name: Check status of collectd service
121           shell: >
122             /usr/bin/systemctl show collectd --property ActiveState |
123             grep '\bactive\b'
124           when: collectd_enabled.rc == 0
125           tags: step0,validation
126         - name: Stop collectd service
127           tags: step1
128           when: collectd_enabled.rc == 0
129           service: name=collectd state=stopped
130         - name: Install collectd package if it was disabled
131           tags: step3
132           yum: name=collectd state=latest
133           when: collectd_enabled.rc != 0