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