fix(ci): клонировать репозиторий вне /tmp, чтобы Ansible читал ansible.cfg
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
87d468c8c1
commit
fe32ee55c2
1 file changed
+4
-4
@@ -36,18 +36,18 @@ jobs:
|
|||||||
sudo apt-get install -y git openssh-client ansible-core python3
|
sudo apt-get install -y git openssh-client ansible-core python3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf /tmp/homelab-infra
|
rm -rf "${HOME}/homelab-infra"
|
||||||
git clone https://gitea.gunihome.ru/karpenok/homelab-infra.git /tmp/homelab-infra
|
git clone https://gitea.gunihome.ru/karpenok/homelab-infra.git "${HOME}/homelab-infra"
|
||||||
sha="${GITHUB_SHA:-${GITEA_SHA:-}}"
|
sha="${GITHUB_SHA:-${GITEA_SHA:-}}"
|
||||||
if [ -n "${sha}" ]; then
|
if [ -n "${sha}" ]; then
|
||||||
git -C /tmp/homelab-infra checkout "${sha}"
|
git -C "${HOME}/homelab-infra" checkout "${sha}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install -d -m 700 "${HOME}/.ssh"
|
install -d -m 700 "${HOME}/.ssh"
|
||||||
printf '%s\n' "${RUNNER_SSH_KEY}" > "${HOME}/.ssh/id_ed25519"
|
printf '%s\n' "${RUNNER_SSH_KEY}" > "${HOME}/.ssh/id_ed25519"
|
||||||
chmod 600 "${HOME}/.ssh/id_ed25519"
|
chmod 600 "${HOME}/.ssh/id_ed25519"
|
||||||
|
|
||||||
cd /tmp/homelab-infra
|
cd "${HOME}/homelab-infra"
|
||||||
ansible-inventory -i inventories/prod/hosts.yml --list > /tmp/inventory.json
|
ansible-inventory -i inventories/prod/hosts.yml --list > /tmp/inventory.json
|
||||||
python3 - <<'PY'
|
python3 - <<'PY'
|
||||||
import json, subprocess
|
import json, subprocess
|
||||||
|
|||||||
Reference in new issue
Block a user