chore: remove NetBird and Authentik layers from homelab
ansible-deploy / plan (push) Successful in 2s
ansible-lint / lint (push) Successful in 3s
ansible-deploy / deploy (core-mon, ) (push) Successful in 39s
ansible-deploy / deploy (core-net, ) (push) Successful in 57s
ansible-deploy / deploy (core-secrets, ) (push) Successful in 25s
ansible-deploy / deploy (ger-nod-02, ) (push) Successful in 57s
ansible-deploy / deploy (opnsense, ) (push) Successful in 15s

This commit is contained in:
karpenok committed 2026-11-19 10:50:19 +07:00
1 parent 6417bdcc75
commit 6a2f90797a
55 files changed
+134 -2460

No files matched your search

+42 -4
View File
@@ -5,15 +5,53 @@
roles:
- role: core-net/traefik
tags: [traefik]
- role: core-net/authentik
tags: [authentik]
- role: core-net/vmagent
tags: [vmagent]
- role: core-net/netbird
tags: [netbird]
- role: vector
tags: [vector]
tasks:
- name: Удалить остатки NetBird и Authentik на core-net
tags: [always]
block:
- name: Проверить наличие клиента NetBird
ansible.builtin.stat:
path: /usr/bin/netbird
register: core_net_nb_bin
- name: Отключить и остановить NetBird
ansible.builtin.command: netbird down
when: core_net_nb_bin.stat.exists
changed_when: true
failed_when: false
- name: Удалить пакет netbird
ansible.builtin.apt:
name: netbird
state: absent
purge: true
when: core_net_nb_bin.stat.exists
- name: Остановить и удалить контейнеры Authentik (если остались)
ansible.builtin.stat:
path: /opt/authentik/compose.yaml
register: core_net_authentik_compose
- name: Остановить стек Authentik
ansible.builtin.command: docker compose -f /opt/authentik/compose.yaml down -v --remove-orphans
when: core_net_authentik_compose.stat.exists
changed_when: true
failed_when: false
- name: Удалить файлы и каталоги NetBird и Authentik
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- /etc/apt/sources.list.d/netbird.list
- /usr/share/keyrings/netbird-archive-keyring.gpg
- /etc/netbird
- /var/lib/netbird
- /opt/authentik
- name: Развернуть панель Remnawave
ansible.builtin.import_role:
name: core-net/remnawave
-2
View File
@@ -3,8 +3,6 @@
hosts: ger-nod-02
gather_facts: false
roles:
- role: netbird_exit_node
tags: [netbird]
- role: remnanode
tags: [remnanode]
- role: vmagent
+45 -4
View File
@@ -2,9 +2,50 @@
- name: Маршрутизатор OPNsense
hosts: opnsense
gather_facts: false
pre_tasks:
- name: Проверить наличие плагина os-netbird на OPNsense
ansible.builtin.uri:
url: "https://{{ opnsense_host }}/api/netbird/service/status"
method: GET
url_username: "{{ lookup('env', 'OPNSENSE_API_KEY') }}"
url_password: "{{ lookup('env', 'OPNSENSE_API_SECRET') }}"
force_basic_auth: true
validate_certs: false
status_code: [200, 404]
register: opnsense_nb_check
tags: [always]
- name: Остановить службу NetBird на OPNsense перед удалением плагина
ansible.builtin.uri:
url: "https://{{ opnsense_host }}/api/netbird/service/stop"
method: POST
url_username: "{{ lookup('env', 'OPNSENSE_API_KEY') }}"
url_password: "{{ lookup('env', 'OPNSENSE_API_SECRET') }}"
force_basic_auth: true
validate_certs: false
body_format: json
body: {}
status_code: [200]
when: opnsense_nb_check.status == 200 and (opnsense_nb_check.json.status | default('')) == 'running'
changed_when: true
failed_when: false
tags: [always]
- name: Удалить плагин os-netbird из OPNsense
ansible.builtin.uri:
url: "https://{{ opnsense_host }}/api/core/firmware/remove/os-netbird"
method: POST
url_username: "{{ lookup('env', 'OPNSENSE_API_KEY') }}"
url_password: "{{ lookup('env', 'OPNSENSE_API_SECRET') }}"
force_basic_auth: true
validate_certs: false
body_format: json
body: {}
status_code: [200]
when: opnsense_nb_check.status == 200
changed_when: true
tags: [always]
roles:
- role: opnsense/netbird
tags: [netbird]
- role: opnsense/xray
tags: [xray]
post_tasks:
@@ -15,7 +56,7 @@
agent_vault_service_name: opnsense
agent_vault_service_description: >-
Маршрутизатор OPNsense (opnsense.gunihome.ru): статус системы, интерфейсы,
правила фаервола, маршруты, NetBird и Xray. Read-only доступ (GET) через
правила фаервола, маршруты и Xray. Read-only доступ (GET) через
Basic Auth (OPNSENSE_API_KEY / OPNSENSE_API_SECRET).
agent_vault_service_host: "opnsense.gunihome.ru:443"
agent_vault_service_paths: ["/api"]
@@ -24,4 +65,4 @@
agent_vault_secret_path: /services/opnsense
agent_vault_secret_username_key: OPNSENSE_API_KEY
agent_vault_secret_password_key: OPNSENSE_API_SECRET
tags: [agent_vault, netbird, xray]
tags: [agent_vault, xray]
-2
View File
@@ -3,8 +3,6 @@
hosts: remnanodes
gather_facts: false
roles:
- role: netbird_exit_node
tags: [netbird]
- role: remnanode
tags: [remnanode]
- role: vmagent
-9
View File
@@ -1,9 +0,0 @@
---
- name: VPS rus-central, NetBird
hosts: rus-central
gather_facts: false
roles:
- role: rus-central/netbird
tags: [netbird]
- role: rus-central/cadvisor
tags: [cadvisor]
-1
View File
@@ -4,6 +4,5 @@
- ansible.builtin.import_playbook: core-secrets.yml
- ansible.builtin.import_playbook: core-mon.yml
- ansible.builtin.import_playbook: core-git.yml
- ansible.builtin.import_playbook: rus-central.yml
- ansible.builtin.import_playbook: remnanodes.yml
- ansible.builtin.import_playbook: opnsense.yml