ansible/roles/netdata/tasks/config.yml

76 lines
1.9 KiB
YAML
Raw Normal View History

2021-01-23 18:45:20 -06:00
---
- name: config | Configuring Netdata
template:
src: netdata.conf.j2
dest: "{{ netdata_config_file }}"
owner: "{{ netdata_user_info['user'] }}"
group: root
mode: u=rx,g=rx,o=r
notify: restart netdata
become: true
- name: config | Configuring Netdata Alarm Notifications
template:
dest: "{{ netdata_alarm_config_file }}"
owner: "{{ netdata_user_info['user'] }}"
group: root
src: "health_alarm_notify.conf.j2"
mode: u=rw,g=rw,o=r
notify: restart netdata
become: true
when: netdata_alarm_configure
- name: config | Configuring Netdata streaming
template:
src: stream.conf.j2
dest: "{{ netdata_stream_config_file }}"
owner: "{{ netdata_user_info['user'] }}"
group: root
mode: u=rx,g=rx,o=r
notify: restart netdata
become: true
when: netdata_stream_enabled
- name: config | Configuring Netdata Service (systemd)
template:
src: etc/systemd/system/netdata.service.j2
dest: /etc/systemd/system/netdata.service
owner: root
group: root
mode: u=rw,g=rw,o=r
notify:
- reload systemd netdata
- restart netdata
become: true
when: ansible_service_mgr == "systemd"
- name: config | Configuring Netdata Service (upstart|sysvinit) - Debian
template:
src: etc/init.d/netdata.debian.j2
dest: /etc/init.d/netdata
owner: root
group: root
mode: u=rwx,g=rx,o=rx
notify:
- restart netdata
become: true
when: >
(ansible_service_mgr == "upstart"
or ansible_service_mgr == "sysvinit") and
ansible_os_family == "Debian"
- name: config | Configuring Netdata Service (upstart|sysvinit) - RedHat
template:
src: etc/init.d/netdata.redhat.j2
dest: /etc/init.d/netdata
owner: root
group: root
mode: u=rwx,g=rx,o=rx
notify:
- restart netdata
become: true
when: >
(ansible_service_mgr == "upstart"
or ansible_service_mgr == "sysvinit") and
ansible_os_family == "RedHat"