aboutsummaryrefslogtreecommitdiffstats
path: root/puppet/services/metrics/collectd.yaml
blob: 26dbd4c5de83e59b3879a9a77a1aa3a532bf68d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
heat_template_version: ocata

description: Collectd client service

parameters:
  ServiceNetMap:
    default: {}
    description: Mapping of service_name -> network name. Typically set
                 via parameter_defaults in the resource registry.  This
                 mapping overrides those in ServiceNetMapDefaults.
    type: json
  EndpointMap:
    default: {}
    description: Mapping of service endpoint -> protocol. Typically set
                 via parameter_defaults in the resource registry.
    type: json
  DefaultPasswords:
    default: {}
    type: json
  RoleName:
    default: ''
    description: Role name on which the service is applied
    type: string
  RoleParameters:
    default: {}
    description: Parameters specific to the role
    type: json
  CollectdDefaultPlugins:
    default:
      - disk
      - interface
      - load
      - memory
      - processes
      - tcpconns
    type: comma_delimited_list
    description: >
      List of collectd plugins to activate on all overcloud hosts.  See
      the documentation for the puppet-collectd module for a list plugins
      supported by the module (https://github.com/voxpupuli/puppet-collectd).
      Set this key to override the default list of plugins.  Use
      CollectdExtraPlugins if you want to load additional plugins without
      overriding the defaults.
  CollectdExtraPlugins:
    default: []
    type: comma_delimited_list
    description: >
      List of collectd plugins to activate on all overcloud hosts.  See
      the documentation for the puppet-collectd module for a list plugins
      supported by the module (https://github.com/voxpupuli/puppet-collectd).
      Set this key to load plugins in addition to those in
      CollectdDefaultPlugins.
  CollectdServer:
    type: string
    description: >
      Address of remote collectd server to which we will send
      metrics.
    default: ''
  CollectdServerPort:
    type: number
    default: 25826
    description: >
      Port on remote collectd server to which we will send
      metrics.
  CollectdUsername:
    type: string
    description: >
      Username for authenticating to the remote collectd server. The default
      is to not configure any authentication.
    default: ''
  CollectdPassword:
    type: string
    hidden: true
    description: >
      Password for authenticating to the remote collectd server. The
      default is to not configure any authentication.
    default: ''
  CollectdSecurityLevel:
    type: string
    description: >
      Security level setting for remote collectd connection. If it is
      set to Sign or Encrypt the CollectdPassword and CollectdUsername
      parameters need to be set.
    default: 'None'
    constraints:
      - allowed_values:
          - None
          - Sign
          - Encrypt

outputs:
  role_data:
    description: Role data for the Collectd client role.
    value:
      service_name: collectd
      config_settings:
        collectd::manage_repo: false
        collectd::purge: true
        collectd::recurse: true
        collectd::purge_config: true
        collectd::minimum_version: "5.7"
        tripleo::profile::base::metrics::collectd::collectd_server:
          get_param: CollectdServer
        tripleo::profile::base::metrics::collectd::collectd_port:
          get_param: CollectdServerPort
        tripleo::profile::base::metrics::collectd::collectd_username:
          get_param: CollectdUsername
        tripleo::profile::base::metrics::collectd::collectd_password:
          get_param: CollectdPassword
        tripleo::profile::base::metrics::collectd::collectd_securitylevel:
          get_param: CollectdSecurityLevel
        tripleo.collectd.plugins.collectd:
          yaql:
            data:
              default_plugins: {get_param: CollectdDefaultPlugins}
              extra_plugins: {get_param: CollectdExtraPlugins}
            expression: >
              ($.data.default_plugins + $.data.extra_plugins)
              .flatten().distinct()
      step_config: |
        include ::tripleo::profile::base::metrics::collectd
      upgrade_tasks:
        - name: Check if collectd is deployed
          command: systemctl is-enabled collectd
          tags: common
          ignore_errors: True
          register: collectd_enabled
        - name: Check status of collectd service
          shell: >
            /usr/bin/systemctl show collectd --property ActiveState |
            grep '\bactive\b'
          when: collectd_enabled.rc == 0
          tags: step0,validation
        - name: Stop collectd service
          tags: step1
          when: collectd_enabled.rc == 0
          service: name=collectd state=stopped
        - name: Install collectd package if it was disabled
          tags: step3
          yum: name=collectd state=latest
          when: collectd_enabled.rc != 0