feat: added install netdata

This commit is contained in:
2024-02-26 10:06:46 +00:00
parent 766f2d0cb5
commit 7c02a824b5
3 changed files with 34 additions and 1 deletions

View File

@@ -21,4 +21,7 @@ swarm_init: false
docker_cron_path: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
docker_cronjob_prune: true
docker_compose_deploy: true
docker_compose_deploy: false
docker_netdata_install: false
docker_netdata_port: 19999
docker_netdata_version: 'v1.44.2'

View File

@@ -17,3 +17,7 @@
- name: Configure docker system prune with cron
when: docker_cronjob_prune
include_tasks: prune.yml
- name: install netdata
when: docker_netdata_install
include_tasks: netdata.yml

26
tasks/netdata.yml Normal file
View File

@@ -0,0 +1,26 @@
---
- name: Deploy Netdata Docker container
community.docker.docker_container:
name: netdata
image: "netdata/netdata:{{ docker_netdata_version }}"
hostname: "{{ ansible_hostname }}"
restart_policy: always
pid_mode: host
published_ports:
- "{{ docker_netdata_port }}:19999"
capabilities:
- SYS_PTRACE
- SYS_ADMIN
security_opts:
- apparmor:unconfined
volumes:
- /mnt/docker/netdata/etc:/etc/netdata
- /mnt/docker/netdata/var_lib:/var/lib/netdata
- /mnt/docker/netdata/var_cache:/var/cache/netdata
- /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
- /var/run/docker.sock:/var/run/docker.sock:ro
state: started