From 822ae4399269de2fc3098b149d70abcb8f4ae178 Mon Sep 17 00:00:00 2001 From: karpenok Date: Wed, 11 Nov 2026 12:57:44 +0700 Subject: [PATCH] feat(opnsense): add declarative NetBird plugin role and CI workflow --- .gitea/workflows/ansible-opnsense.yml | 39 +++++++++++++++++++ .../inventories/prod/host_vars/opnsense.yml | 4 ++ 2 files changed, 43 insertions(+) create mode 100644 .gitea/workflows/ansible-opnsense.yml create mode 100644 ansible/inventories/prod/host_vars/opnsense.yml diff --git a/.gitea/workflows/ansible-opnsense.yml b/.gitea/workflows/ansible-opnsense.yml new file mode 100644 index 0000000..05881aa --- /dev/null +++ b/.gitea/workflows/ansible-opnsense.yml @@ -0,0 +1,39 @@ +name: ansible-opnsense + +on: + push: + branches: + - main + paths: + - 'ansible/ansible.cfg' + - 'ansible/ci/**' + - 'ansible/roles/opnsense/**' + - 'ansible/playbooks/opnsense.yml' + - 'ansible/playbooks/site.yml' + - 'ansible/inventories/prod/hosts.yml' + - 'ansible/inventories/prod/host_vars/opnsense.yml' + - 'ansible/inventories/prod/group_vars/**' + workflow_dispatch: + +jobs: + deploy: + runs-on: homelab + container: + image: homelab-ansible:latest + timeout-minutes: 30 + steps: + - name: Деплой opnsense + env: + INFISICAL_CLIENT_ID: ${{ secrets.INFISICAL_CLIENT_ID }} + INFISICAL_CLIENT_SECRET: ${{ secrets.INFISICAL_CLIENT_SECRET }} + run: | + set -eu + rm -rf "${HOME}/homelab-infra" + git clone http://192.168.1.217:3000/karpenok/homelab-infra.git "${HOME}/homelab-infra" + sha="${GITHUB_SHA:-${GITEA_SHA:-}}" + if [ -n "${sha}" ]; then + git -C "${HOME}/homelab-infra" checkout "${sha}" + fi + chmod -R go-w "${HOME}/homelab-infra" + exec bash "${HOME}/homelab-infra/ansible/ci/deploy-machine.sh" opnsense "${{ github.event_name }}" "${{ github.event.before }}" "${{ github.sha }}" + diff --git a/ansible/inventories/prod/host_vars/opnsense.yml b/ansible/inventories/prod/host_vars/opnsense.yml new file mode 100644 index 0000000..7fdfe98 --- /dev/null +++ b/ansible/inventories/prod/host_vars/opnsense.yml @@ -0,0 +1,4 @@ +--- +opnsense_host: 192.168.1.1 +opnsense_netbird_management_url: "https://central.gunihome.ru:443" +