From d1528c8e31bf03599776b64bda6f95f19f585bbb Mon Sep 17 00:00:00 2001 From: hogweed1 Date: Thu, 11 Jun 2026 00:21:28 +1000 Subject: [PATCH] make prometheus less big --- files/prometheus/prometheus.service | 1 + playbooks/_common-setup.yml | 2 ++ playbooks/ntp-chrony.yml | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/files/prometheus/prometheus.service b/files/prometheus/prometheus.service index e67ca33..fcaf2a9 100644 --- a/files/prometheus/prometheus.service +++ b/files/prometheus/prometheus.service @@ -15,6 +15,7 @@ ExecStart=/usr/sbin/prometheus \ --web.config.file=/etc/prometheus/web-config.yaml \ --storage.tsdb.path /prometheus-data/ \ --storage.tsdb.retention.time 180d \ + --storage.tsdb.retention.size 35GB \ --storage.tsdb.max-block-duration=2h \ --storage.tsdb.min-block-duration=2h \ --web.enable-remote-write-receiver \ diff --git a/playbooks/_common-setup.yml b/playbooks/_common-setup.yml index ae285a8..7c8c132 100644 --- a/playbooks/_common-setup.yml +++ b/playbooks/_common-setup.yml @@ -20,6 +20,8 @@ label: "{{ item.ansible_host }}" - import_playbook: timezone.yml +- import_playbook: ntp-chrony.yml + - import_playbook: packages.yml - import_playbook: resolvconf.yml - import_playbook: users.yml diff --git a/playbooks/ntp-chrony.yml b/playbooks/ntp-chrony.yml index 9227050..b67647f 100644 --- a/playbooks/ntp-chrony.yml +++ b/playbooks/ntp-chrony.yml @@ -46,5 +46,5 @@ name: chrony state: started enabled: yes - # Магия фильтрации: применяем ТОЛЬКО если это не гостевой LXC - when: not (ansible_virtualization_type == 'lxc' and ansible_virtualization_role == 'guest') \ No newline at end of file + # Просто и со вкусом: если в фактах есть lxc — сразу пропускаем задачу + when: ansible_virtualization_type != 'lxc' \ No newline at end of file