1
0

Netdata + Caddy: add monitoring for http-server

This commit is contained in:
2025-05-17 11:55:38 +03:00
parent 7893349da4
commit eea8db6499
6 changed files with 159 additions and 123 deletions

View File

@ -11,6 +11,7 @@
app_user: "{{ app_name }}"
base_dir: "/home/{{ app_user }}"
config_dir: "{{ (base_dir, 'config') | path_join }}"
config_go_d_dir: "{{ (config_dir, 'go.d') | path_join }}"
data_dir: "{{ (base_dir, 'data') | path_join }}"
tasks:
@ -30,6 +31,7 @@
mode: "0770"
loop:
- "{{ config_dir }}"
- "{{ config_go_d_dir }}"
- "{{ data_dir }}"
- name: "Copy netdata config file"
@ -40,6 +42,14 @@
group: "{{ app_user }}"
mode: "0640"
- name: "Copy prometheus plugin config file"
ansible.builtin.copy:
src: "files/{{ app_name }}/go.d/prometheus.conf"
dest: "{{ config_go_d_dir }}/prometheus.conf"
owner: "{{ app_user }}"
group: "{{ app_user }}"
mode: "0640"
- name: "Grab docker group id."
ansible.builtin.shell:
cmd: |
@ -62,3 +72,8 @@
project_src: "{{ base_dir }}"
state: "present"
remove_orphans: true
- name: "Restart application with docker compose"
community.docker.docker_compose_v2:
project_src: "{{ base_dir }}"
state: "restarted"