feat: VictoriaMetrics и NetBird между панелью и ger-nod-02
ansible-core-net / deploy (push) Canceled after 0s
ansible-core-secrets / deploy (push) Canceled after 0s
ansible-ger-nod-02 / deploy (push) Canceled after 0s
ansible-opnsense / deploy (push) Canceled after 0s
ansible-core-mon / deploy (push) Successful in 58s
ansible-rus-central / deploy (push) Successful in 44s
ansible-core-net / deploy (push) Canceled after 0s
ansible-core-secrets / deploy (push) Canceled after 0s
ansible-ger-nod-02 / deploy (push) Canceled after 0s
ansible-opnsense / deploy (push) Canceled after 0s
ansible-core-mon / deploy (push) Successful in 58s
ansible-rus-central / deploy (push) Successful in 44s
Prometheus остаётся для LAN. Нода отдаёт метрики через vmagent, а панель ходит на неё по отдельному ключу NetBird, не через группу роутеров. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
5704272c18
commit
72a9c86e52
46 files changed
+13496
-25
No files matched your search
@@ -1,4 +1,7 @@
|
||||
---
|
||||
monitoring_node_exporter_public: true
|
||||
monitoring_node_exporter_listen: "0.0.0.0:9100"
|
||||
|
||||
host_authorized_keys:
|
||||
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF/yxhAs022l/8FlPlhyi7NeF3CvVGsev3B1HtKICO7M root_from_windows"
|
||||
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEpwqB40k8QQq3k8160gfMKDaCJCX9qzvmuijfe3mO4I gitea-runner"
|
||||
|
||||
@@ -91,11 +91,22 @@
|
||||
failed_when: false
|
||||
changed_when: rm_legacy_exporter.rc == 0
|
||||
|
||||
- name: Слушать node-exporter только локально
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/default/prometheus-node-exporter
|
||||
content: |
|
||||
ARGS="--web.listen-address={{ monitoring_node_exporter_listen }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
register: node_exporter_args
|
||||
when: not (monitoring_node_exporter_public | bool)
|
||||
|
||||
- name: Включить prometheus-node-exporter
|
||||
ansible.builtin.systemd:
|
||||
name: prometheus-node-exporter
|
||||
enabled: true
|
||||
state: started
|
||||
state: "{{ 'restarted' if (node_exporter_args is changed) else 'started' }}"
|
||||
|
||||
- name: Разрешить SSH
|
||||
ansible.builtin.command: ufw allow OpenSSH
|
||||
@@ -107,7 +118,19 @@
|
||||
ansible.builtin.command: ufw allow 9100/tcp
|
||||
register: ufw_metrics
|
||||
changed_when: "'added' in (ufw_metrics.stdout | lower)"
|
||||
when: ansible_virtualization_type | default('') != 'lxc'
|
||||
when:
|
||||
- ansible_virtualization_type | default('') != 'lxc'
|
||||
- monitoring_node_exporter_public | bool
|
||||
|
||||
- name: Закрыть порт метрик node-exporter снаружи
|
||||
ansible.builtin.command: ufw --force delete allow 9100/tcp
|
||||
register: ufw_metrics_del
|
||||
changed_when: "'deleted' in (stdout | default('') | lower)"
|
||||
failed_when: false
|
||||
loop: [1, 2]
|
||||
when:
|
||||
- ansible_virtualization_type | default('') != 'lxc'
|
||||
- not (monitoring_node_exporter_public | bool)
|
||||
|
||||
- name: Проверить состояние firewall
|
||||
ansible.builtin.command: ufw status
|
||||
|
||||
Reference in new issue
Block a user