Funktionsfähig
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 39s

This commit is contained in:
sotos
2025-12-17 08:57:17 +01:00
parent c8f490d8aa
commit 2618ea8ec3

View File

@@ -39,14 +39,24 @@ jobs:
pip3 install --upgrade pip pip3 install --upgrade pip
pip3 install ansible pip3 install ansible
- name: Setup SSH key with passphrase - name: Setup SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }}
run: | run: |
echo " Checking SSH key setup..." mkdir -p ~/.ssh
head -5 ~/.ssh/id_rsa | cat -v chmod 700 ~/.ssh
echo " Testing SSH connection..."
ssh -i ~/.ssh/id_rsa root@213.95.90.157 'echo SSH connection successful'
echo " Running Ansible Playbook..."
- name: Run Ansible deployment echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa <<< "$SSH_PASSPHRASE"
ssh -o BatchMode=yes root@213.95.90.157 "echo SSH OK"
- name: Run Ansible
run: | run: |
ansible-playbook -i ansible/inventory.yaml site.yaml ansible-playbook -i ansible/inventory.yaml site.yaml