53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
|
---
|
||
|
- name: "install netdata"
|
||
|
ansible.builtin.apt:
|
||
|
name:
|
||
|
- "netdata"
|
||
|
- "uuid-runtime"
|
||
|
register: system_extra_netdata_install
|
||
|
|
||
|
- name: "enable netdata"
|
||
|
ansible.builtin.systemd:
|
||
|
name: "netdata"
|
||
|
enabled: true
|
||
|
|
||
|
- name: "resolve netdata registry via hosts file (inet)"
|
||
|
ansible.builtin.lineinfile:
|
||
|
path: "/etc/hosts"
|
||
|
line: "{{ system_extra_netdata_registry_inet_address }} {{ system_extra_netdata_registry_url }}"
|
||
|
insertafter: "EOF"
|
||
|
|
||
|
- name: "resolve netdata registry via hosts file (inet6)"
|
||
|
ansible.builtin.lineinfile:
|
||
|
path: "/etc/hosts"
|
||
|
line: "{{ system_extra_netdata_registry_inet6_address }} {{ system_extra_netdata_registry_url }}"
|
||
|
insertafter: "EOF"
|
||
|
|
||
|
- name: "configure netdata"
|
||
|
ansible.builtin.template:
|
||
|
src: "./netdata.conf"
|
||
|
dest: "/etc/netdata/netdata.conf"
|
||
|
register: system_extra_netdata_netdata_conf
|
||
|
|
||
|
- name: "configure netdata stream"
|
||
|
ansible.builtin.template:
|
||
|
src: "./stream.conf"
|
||
|
dest: "/etc/netdata/stream.conf"
|
||
|
register: system_extra_netdata_stream_conf
|
||
|
|
||
|
- name: "start netdata"
|
||
|
ansible.builtin.systemd:
|
||
|
name: "netdata"
|
||
|
state: "started"
|
||
|
register: system_extra_netdata_start
|
||
|
|
||
|
- name: "restart netdata"
|
||
|
ansible.builtin.systemd:
|
||
|
name: "netdata"
|
||
|
state: "restarted"
|
||
|
when:
|
||
|
(system_extra_netdata_install.changed or
|
||
|
system_extra_netdata_netdata_conf.changed or
|
||
|
system_extra_netdata_stream_conf.changed) and
|
||
|
not system_extra_netdata_start.changed
|