blob: f05eff427e7f22a76ca55b36ec30bfc5e5494c3d (
plain) (
blame)
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
|
---
- name: Install requirements (Debian family)
apt:
name: curl
state: present
when: ansible_os_family == 'Debian'
- name: Install requirements (Redhat family)
yum:
name: curl
state: present
when: ansible_os_family == 'RedHat'
- name: Check if netdata is installed
command: "{{ prefix }}netdata -V"
ignore_errors: true
register: netdata_installed_st
changed_when: false
vars:
prefix: "{{ netdata_prefix | ternary(netdata_prefix~'/bin/', '') }}"
- name: Uninstall netdata
include: uninstall.yml
when:
- netdata_uninstall_before is defined
- netdata_uninstall_before | bool
- name: Install netdata
shell:
cmd: bash <(curl -Ss https://my-netdata.io/{{ netdata_installer }}.sh) --dont-wait {{ netdata_install_options }}
args:
executable: /bin/bash
when:
- netdata_installed_st is failed or netdata_force_install or netdata_uninstall_before
- name: Configure netdata
template:
src: netdata.conf.j2
dest: "{{ netdata_prefix }}/etc/netdata/netdata.conf"
owner: root
group: root
mode: 0644
notify: restart netdata
- name: Configure streaming
template:
src: stream.conf.j2
dest: "{{ netdata_prefix }}/etc/netdata/stream.conf"
owner: root
group: netdata
mode: 0640
when:
- netdata_streaming_configuration is defined
- netdata_streaming_configuration | count > 0
notify: restart netdata
- name: Configure netdata alarm notifications
template:
dest: "{{ netdata_prefix }}/etc/netdata/health_alarm_notify.conf"
src: "health_alarm_notify.conf.j2"
owner: netdata
group: root
mode: 0640
when:
- netdata_alarm_notify_configs is defined
- netdata_alarm_notify_configs | count > 0
notify: restart netdata
- name: Configure netdata sensors
include_tasks: config.yml
when: (netdata_extra_config|length > 0) or (netdata_alarms_overrides|length > 0)
|