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