fix(ger-nod-02): читать PASS из /VPS, Cloudflare из /ci-cd
ansible-core-mon / deploy (push) Successful in 26s
ansible-core-net / deploy (push) Successful in 36s
ansible-core-secrets / deploy (push) Successful in 13s
ansible-ger-nod-02 / deploy (push) Failing after 2s
ansible-opnsense / deploy (push) Successful in 4s
ansible-rus-central / deploy (push) Successful in 1m6s
ansible-core-mon / deploy (push) Successful in 26s
ansible-core-net / deploy (push) Successful in 36s
ansible-core-secrets / deploy (push) Successful in 13s
ansible-ger-nod-02 / deploy (push) Failing after 2s
ansible-opnsense / deploy (push) Successful in 4s
ansible-rus-central / deploy (push) Successful in 1m6s
Реальные пути в Infisical: CLOUDFLARE_API в /ci-cd, PASS_GER_NOD_02 в /VPS — без пароля SSH был Permission denied. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
6aa2b26f47
commit
385505b5f7
3 files changed
+19
-14
No files matched your search
@@ -104,8 +104,11 @@ case "$machine" in
|
||||
export OPNSENSE_API_SECRET="${OPNSENSE_API_SECRET:-}"
|
||||
;;
|
||||
ger-nod-02)
|
||||
# SECRET_KEY ноды — /services/remnawave (пишет ansible-core-net).
|
||||
eval "$(infisical export --domain="${INFISICAL_DOMAIN}" --token="${TOKEN}" --env=prod --projectId="${INFISICAL_PROJECT_ID}" --path="/services/remnawave" --format=dotenv-export --silent)"
|
||||
eval "$(infisical export --domain="${INFISICAL_DOMAIN}" --token="${TOKEN}" --env=prod --projectId="${INFISICAL_PROJECT_ID}" --path="/services/cloudflare" --format=dotenv-export --silent)"
|
||||
# Пароль VPS — /VPS (не /services/remnawave).
|
||||
eval "$(infisical export --domain="${INFISICAL_DOMAIN}" --token="${TOKEN}" --env=prod --projectId="${INFISICAL_PROJECT_ID}" --path="/VPS" --format=dotenv-export --silent)"
|
||||
# CLOUDFLARE_API уже из /ci-cd выше; отдельной папки /services/cloudflare нет.
|
||||
export REMNANODE_SECRET_KEY="${REMNANODE_SECRET_KEY:-}"
|
||||
export CLOUDFLARE_API="${CLOUDFLARE_API:-}"
|
||||
export PASS_GER_NOD_02="${PASS_GER_NOD_02:-}"
|
||||
@@ -114,19 +117,21 @@ case "$machine" in
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${CLOUDFLARE_API}" ]; then
|
||||
echo "В Infisical (/services/cloudflare) нет CLOUDFLARE_API" >&2
|
||||
echo "В Infisical (/ci-cd) нет CLOUDFLARE_API" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${PASS_GER_NOD_02}" ]; then
|
||||
echo "В Infisical (/VPS) нет PASS_GER_NOD_02 — нужен для первичного SSH на ger-nod-02" >&2
|
||||
exit 1
|
||||
fi
|
||||
# sshpass нужен для первичного входа по паролю
|
||||
if [ -n "${PASS_GER_NOD_02}" ] && ! command -v sshpass >/dev/null 2>&1; then
|
||||
if ! command -v sshpass >/dev/null 2>&1; then
|
||||
apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq sshpass >/dev/null
|
||||
fi
|
||||
# Первичный вход по паролю; после роли host остаётся только ключ раннера.
|
||||
if [ -n "${PASS_GER_NOD_02}" ]; then
|
||||
export ANSIBLE_HOST_KEY_CHECKING=False
|
||||
extra+=(-e "ansible_password=${PASS_GER_NOD_02}")
|
||||
extra+=(-e "ansible_ssh_common_args=-o PreferredAuthentications=publickey,password -o StrictHostKeyChecking=accept-new")
|
||||
fi
|
||||
export ANSIBLE_HOST_KEY_CHECKING=False
|
||||
extra+=(-e "ansible_password=${PASS_GER_NOD_02}")
|
||||
extra+=(-e "ansible_ssh_common_args=-o PreferredAuthentications=publickey,password -o StrictHostKeyChecking=accept-new")
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in new issue
Block a user