diff --git a/.gitea/workflows/netbird-install.yml b/.gitea/workflows/netbird-install.yml index 0e9e488..0ef53d1 100644 --- a/.gitea/workflows/netbird-install.yml +++ b/.gitea/workflows/netbird-install.yml @@ -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