NewsBlur/ansible/roles/netdata/tasks/main.yml
2021-04-12 14:58:48 -05:00

32 lines
No EOL
1.1 KiB
YAML

---
- name: Setup Netdata docker container
become: yes
docker_container:
name: netdata
state: started
healthcheck:
test: curl localhost:19999
image: netdata/netdata
ports: 19999:19999
hostname: "{{ ansible_hostname }}"
env:
MONITOR_URL: "https://{{ ansible_ssh_host }}/monitor"
STAGING: "True"
volumes:
- /srv/newsblur/docker/netdata/netdataconfig/netdata.conf:/etc/netdata/netdata.conf
- /srv/newsblur/docker/netdata/netdataconfig/python.d.conf:/usr/lib/netdata/conf.d/python.d.conf
- /srv/newsblur/docker/netdata/netdataconfig/conf/:/usr/lib/netdata/conf.d/python.d/
- /srv/newsblur/docker/netdata/netdataconfig/charts/newsblur.chart.py:/usr/libexec/netdata/python.d/newsblur.chart.py
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/os-release:/host/etc/os-release:ro
restart: yes
- name: Add netdata agent to war room
become: yes
ignore_errors: yes
command: docker exec netdata netdata-claim.sh -token={{ netdata_token }} -rooms={{ netdata_room }} -url={{ netdata_url }} -hostname={{ ansible_hostname }}