From 2618ea8ec3f78da1e265a82fdb82c9b716ae00ae Mon Sep 17 00:00:00 2001 From: sotos Date: Wed, 17 Dec 2025 08:57:17 +0100 Subject: [PATCH] =?UTF-8?q?Funktionsf=C3=A4hig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/yamllint.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/yamllint.yml b/.gitea/workflows/yamllint.yml index 130cbbb..9ffa266 100644 --- a/.gitea/workflows/yamllint.yml +++ b/.gitea/workflows/yamllint.yml @@ -39,14 +39,24 @@ jobs: pip3 install --upgrade pip 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: | - echo " Checking SSH key setup..." - head -5 ~/.ssh/id_rsa | cat -v - echo " Testing SSH connection..." - ssh -i ~/.ssh/id_rsa root@213.95.90.157 'echo SSH connection successful' - echo " Running Ansible Playbook..." + mkdir -p ~/.ssh + chmod 700 ~/.ssh - - 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: | - ansible-playbook -i ansible/inventory.yaml site.yaml \ No newline at end of file + ansible-playbook -i ansible/inventory.yaml site.yaml \ No newline at end of file