This repository has been archived on 2022-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
autonomic.netdata/tasks/main.yml
decentral1se bf5b28933c
init
2022-05-30 17:00:00 +02:00

44 lines
1.2 KiB
YAML

---
- name: Ensure mandatory variables are configured
assert:
that: "{{ item }} is defined"
fail_msg: "You must define the '{{ item }}' variable"
with_items:
- netdata_alerta_api_key
- netdata_alerta_recipient
- netdata_alerta_web_hook_url
- name: Check if netdata installation present
stat:
path: /etc/netdata/.environment
register: netdata_install
- name: Download the installer script
get_url:
url: https://my-netdata.io/kickstart.sh
dest: /tmp/netdata-kickstart.sh
mode: a+x
force: true
when: not netdata_install.stat.exists or netdata_upgrade
- name: Run netdata installer script (install/ugrade as required)
command: |
bash /tmp/netdata-kickstart.sh
--dont-wait
--stable-channel
--disable-cloud
when: not netdata_install.stat.exists or netdata_upgrade
notify: Restart netdata
- name: Ensure health_alarm_notify script is in /etc/netdata
copy:
src: /usr/lib/netdata/conf.d/health_alarm_notify.conf
dest: /etc/netdata/health_alarm_notify.conf
remote_src: true
force: false
when: not netdata_install.stat.exists
- name: Include alerta configuration tasks
include: alerta.yml
when: not netdata_install.stat.exists