Update
This commit is contained in:
@@ -41,18 +41,14 @@ jobs:
|
||||
|
||||
- name: Setup SSH key with passphrase
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
printf "%s\n" "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.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 <<< "${{ secrets.SSH_PASSPHRASE }}"
|
||||
|
||||
echo " Checking SSH key setup..."
|
||||
head -5 ~/.ssh/id_rsa | cat -v
|
||||
ls -l ~/.ssh/id_rsa
|
||||
file ~/.ssh/id_rsa || echo "file command not available"
|
||||
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
|
||||
run: |
|
||||
if [ -n "$SSH_PASSPHRASE" ]; then
|
||||
eval "$(ssh-agent -s)"
|
||||
ssh-add ~/.ssh/id_rsa <<< "$SSH_PASSPHRASE"
|
||||
fi
|
||||
ansible-playbook -i ansible/inventory.yaml site.yaml
|
||||
ansible-playbook -i ansible/inventory.yaml site.yaml
|
||||
Reference in New Issue
Block a user