fix(monitoring): Prometheus читает новый конфиг, а не старый inode
ansible-core-mon / deploy (push) Successful in 13s
ansible-core-mon / deploy (push) Successful in 13s
Файл в bind-mount не обновлялся после записи Ansible, поэтому ger-nod-02 не попадал в цели. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
408dfd09c3
commit
a54a25ebb7
3 files changed
+11
-33
No files matched your search
@@ -55,7 +55,7 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: Reload Prometheus configuration
|
||||
register: prometheus_config
|
||||
|
||||
- name: Установить правила алертов Prometheus
|
||||
ansible.builtin.copy:
|
||||
@@ -64,7 +64,7 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: Reload Prometheus configuration
|
||||
register: prometheus_alerts
|
||||
|
||||
- name: Установить конфигурацию Alertmanager
|
||||
ansible.builtin.template:
|
||||
@@ -105,7 +105,6 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: Restart Grafana
|
||||
|
||||
- name: Установить compose.yaml для стека мониторинга
|
||||
ansible.builtin.template:
|
||||
@@ -114,12 +113,18 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
register: monitoring_compose
|
||||
|
||||
- name: Запустить стек мониторинга через Docker Compose
|
||||
ansible.builtin.command: docker compose -f {{ monitoring_dir }}/compose.yaml up -d --remove-orphans
|
||||
register: compose_up
|
||||
changed_when: "'Started' in compose_up.stderr or 'Created' in compose_up.stderr or 'Recreated' in compose_up.stderr or 'Pulled' in compose_up.stderr"
|
||||
|
||||
- name: Пересоздать Prometheus, чтобы подхватить конфиг
|
||||
ansible.builtin.command: docker compose -f {{ monitoring_dir }}/compose.yaml up -d --force-recreate --no-deps prometheus
|
||||
when: prometheus_config is changed or prometheus_alerts is changed or monitoring_compose is changed
|
||||
changed_when: true
|
||||
|
||||
- name: Дождаться готовности Ntfy
|
||||
ansible.builtin.uri:
|
||||
url: "http://127.0.0.1:80/v1/health"
|
||||
|
||||
Reference in new issue
Block a user