Add systemd support to collectd state (#151)

This commit is contained in:
niku64 2020-12-02 22:04:39 +03:00 committed by GitHub
parent 9443507ff3
commit aa034c3867
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,18 +6,19 @@ collectd:
service.running:
- enable: True
- watch:
- file: /etc/conf.d/collectd
- file: /etc/collectd/collectd.conf
- file: /etc/collectd/types.db
- file: /etc/collectd/conf.d/
- file: /etc/init.d/collectd
{% if grains['init'] == 'openrc' %}
/etc/init.d/collectd:
file.managed:
- source: salt://collectd/files/collectd.init
- mode: 755
- user: root
- group: root
- watch_in:
- service: collectd
/etc/conf.d/collectd:
file.managed:
@ -25,6 +26,25 @@ collectd:
- mode: 644
- user: root
- group: root
- watch_in:
- service: collectd
/etc/systemd/system/collectd.service: file.absent
{% elif grains['init'] == 'systemd' %}
/etc/systemd/system/collectd.service:
file.managed:
- source: salt://collectd/files/collectd.service
- mode: 755
- user: root
- group: root
- watch_in:
- service: collectd
/etc/init.d/collectd: file.absent
/etc/conf.d/collectd: file.absent
{% endif %}
/etc/collectd.conf: file.absent
/etc/collectd:
file.directory:
@ -77,6 +97,13 @@ collectd:
- user: root
- group: collectd
/etc/collectd/conf.d/placeholder.conf:
file.managed:
- mode: 755
- user: root
- group: root
- contents: ""
/etc/collectd/conf.d/10-jmx.conf:
{% if extra_plugin_config.get('jmx', False) %}
file.managed: