mirror of
https://github.com/GeekOops/geekoops-collectd.git
synced 2024-05-20 04:22:21 +00:00
16cd66fbea
Adding GitHub Actions as CI
48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
---
|
|
# tasks file for geekoops-collectd
|
|
|
|
# Distribution specific vars are ALWAYS needed, so don't forget the tags here
|
|
- name: include distribution specific vars
|
|
include_vars: "{{ansible_distribution}}_{{ansible_distribution_version}}.yml"
|
|
tags: ['collectd']
|
|
|
|
- name: Install collectd
|
|
package:
|
|
name: "{{ packages }}"
|
|
# Important: Leave state: present, as we will overwrite the existing config
|
|
# when this task changes!
|
|
state: present
|
|
register: install
|
|
tags: ['collectd']
|
|
|
|
- name: Perform collectd first config
|
|
template:
|
|
src: collectd.conf.j2
|
|
dest: /etc/collectd.conf
|
|
owner: root
|
|
group: root
|
|
mode: 0640
|
|
force: true
|
|
tags: ['collectd']
|
|
when: install.changed == true
|
|
notify: restart collectd
|
|
|
|
- name: Ensure collectd is configured
|
|
template:
|
|
src: collectd.conf.j2
|
|
dest: /etc/collectd.conf
|
|
owner: root
|
|
group: root
|
|
mode: 0640
|
|
force: "{{overwrite}}"
|
|
tags: ['collectd']
|
|
when: install.changed == false
|
|
notify: restart collectd
|
|
|
|
- name: Ensure collectd is enabled
|
|
systemd:
|
|
name: collectd
|
|
state: started
|
|
enabled: true
|
|
tags: ['collectd']
|