1
0

Netdata: add monitoring for postgresql databases

This commit is contained in:
2025-07-29 12:58:01 +03:00
parent 791caab704
commit 6cd8d3b14b
16 changed files with 226 additions and 179 deletions

View File

@@ -42,21 +42,34 @@
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: "Find all go.d plugin config files"
ansible.builtin.find:
paths: "files/{{ app_name }}/go.d"
file_type: file
delegate_to: localhost
register: go_d_source_files
- name: "Copy fail2ban plugin config file"
ansible.builtin.copy:
src: "files/{{ app_name }}/go.d/fail2ban.conf"
dest: "{{ config_go_d_dir }}/fail2ban.conf"
- name: "Template all go.d plugin config files"
ansible.builtin.template:
src: "{{ item.path }}"
dest: "{{ config_go_d_dir }}/{{ item.path | basename }}"
owner: "{{ app_user }}"
group: "{{ app_user }}"
mode: "0640"
loop: "{{ go_d_source_files.files }}"
- name: "Find existing go.d config files on server"
ansible.builtin.find:
paths: "{{ config_go_d_dir }}"
file_type: file
register: go_d_existing_files
- name: "Remove go.d config files that don't exist in source"
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
loop: "{{ go_d_existing_files.files }}"
when: (item.path | basename) not in (go_d_source_files.files | map(attribute='path') | map('basename') | list)
- name: "Grab docker group id."
ansible.builtin.shell: