fix(netbird): подключать раннер к VPS по адресу, а не по домашнему DNS

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
karpenokandCursor committed 2026-11-08 01:03:55 +07:00
1 parent a1573775ef
commit bb6bb5969d
1 file changed
+9 -5
+9 -5
View File
@@ -46,19 +46,23 @@ jobs:
install -d -m 700 "${HOME}/.ssh"
printf '%s\n' "${RUNNER_SSH_KEY}" > "${HOME}/.ssh/id_ed25519"
chmod 600 "${HOME}/.ssh/id_ed25519"
ssh-keyscan -H central.gunihome.ru >> "${HOME}/.ssh/known_hosts"
printf '%s\n' "central.gunihome.ru" > /tmp/netbird-inventory.ini
# Домашний DNS отдаёт central.gunihome.ru на 192.168.1.201. Раннер в этой сети,
# поэтому SSH и проверка идут на публичный адрес VPS.
ssh-keyscan -H 45.154.185.208 >> "${HOME}/.ssh/known_hosts"
cat > /tmp/netbird-inventory.ini <<'EOF'
[netbird]
vps ansible_host=45.154.185.208 ansible_user=root
EOF
ansible-playbook /tmp/homelab-infra/services/netbird/playbook.yml \
-i /tmp/netbird-inventory.ini \
-u root \
--private-key "${HOME}/.ssh/id_ed25519" \
-e "netbird_letsencrypt_email=${NETBIRD_LETSENCRYPT_EMAIL}"
ready=0
for _ in $(seq 1 30); do
code=$(curl -sk -o /dev/null -w '%{http_code}' https://central.gunihome.ru/ || true)
echo "https://central.gunihome.ru/ -> ${code}"
code=$(curl -sk --resolve central.gunihome.ru:443:45.154.185.208 -o /dev/null -w '%{http_code}' https://central.gunihome.ru/ || true)
echo "https://central.gunihome.ru/ через 45.154.185.208 -> ${code}"
if [ "${code}" = "200" ] || [ "${code}" = "302" ]; then
ready=1
break