Merge branch 'collectd' into master

jenkins-master
Dustin 2020-12-23 21:26:01 -06:00
commit 621035e89b
11 changed files with 2230 additions and 0 deletions

10
ci/collectd.jenkinsfile Normal file
View File

@ -0,0 +1,10 @@
@Library('cfgpol')
applyConfigPolicy(
'collectd',
[
'collectd': [
'collectd.yml'
]
]
)

21
collectd.yml Normal file
View File

@ -0,0 +1,21 @@
- hosts: collectd
roles:
- role: collectd
tags:
- collectd
- hosts: prometheus
roles:
- role: collectd-prometheus
tags:
- collectd
- collectd-prometheus
- hosts: collectd
tasks:
- name: ensure collectd is running
service:
name: collectd
state: started
tags:
- service

View File

@ -1,2 +1,5 @@
burp_backup:
- include: /var/lib/homeassistant
collectd_network_servers:
- host: ff18::efc0:4a42
interface: eth0

3
hosts
View File

@ -18,6 +18,9 @@ burp1.pyrocufflink.blue
[certbot]
[collectd:children]
pyrocufflink
[dch-proxy]
[dch-vpn]

View File

@ -1,6 +1,9 @@
[all:vars]
ansible_python_interpreter=/usr/bin/python3
[collectd:children]
pyrocufflink
[dhcpcd:children]
vm-hosts

View File

@ -0,0 +1,7 @@
collectd_default_config: true
collectd_load_network_plugin: true
collectd_network_servers:
- ff18::efc0:4a42
collectd_network_listen: []
collectd_disable_plugins: []

View File

@ -0,0 +1,4 @@
- name: restart collectd
service:
name: collectd
state: restarted

View File

@ -0,0 +1,40 @@
- name: load distribution-specific values
include_vars: '{{ item }}'
with_first_found:
- '{{ ansible_distribution }}.yml'
- defaults.yml
tags:
- always
- name: ensure collectd is installed
package:
name: '{{ collectd_packages }}'
state: present
tags:
- install
- name: ensure collectd is configured
template:
src: collectd.conf.j2
dest: /etc/collectd.conf
mode: '0644'
notify:
- restart collectd
tags:
- collectd-config
- name: ensure collectd network plugin is configured
template:
src: collectd-network.conf.j2
dest: /etc/collectd.d/network.conf
mode: '0644'
notify:
- restart collectd
tags:
- collectd-config
- collectd-network
- name: ensure collectd starts at boot
service:
name: collectd
enabled: true

View File

@ -0,0 +1,24 @@
{% if collectd_load_network_plugin %}
LoadPlugin network
{% endif %}
<Plugin network>
{% for server in collectd_network_servers %}
{% if server is string %}
Server "{{ server }}"
{% elif server.interface is defined %}
<Server "{{ server.host }}"{% if server.port is defined %} {{ server.port }}{% endif %}>
Interface "{{ server.interface }}"
</Server>
{% else %}
Server "{{ server.host }}" {{ server.port }}
{% endif %}
{% endfor %}
{% for listen in collectd_network_listen %}
{% if listen is string %}
Listen "{{ listen }}"
{% else %}
Listen "{{ listen.host }}" {{ listen.port}}
{% endif %}
{% endfor %}
</Plugin>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
collectd_packages:
- collectd
- collectd-chrony
- collectd-disk