Maaa
:erge branch 'main' of https://dns.s-martika.com/smartika/Wordpress-Ansible
This commit is contained in:
@@ -39,17 +39,20 @@ jobs:
|
|||||||
pip3 install --upgrade pip
|
pip3 install --upgrade pip
|
||||||
pip3 install ansible
|
pip3 install ansible
|
||||||
|
|
||||||
|
- name: Setup SSH key with passphrase
|
||||||
- name: Setup SSH
|
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
printf "%s\n" "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/id_rsa
|
||||||
ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts
|
ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts
|
||||||
|
eval "$(ssh-agent -s)"
|
||||||
|
ssh-add ~/.ssh/id_rsa <<< "${{ secrets.SSH_PASSPHRASE }}"
|
||||||
|
|
||||||
- name: Test SSH connection
|
|
||||||
run: |
|
|
||||||
ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=yes root@213.95.90.157 'echo SSH OK'
|
|
||||||
|
|
||||||
- name: Run Ansible deployment
|
- name: Run Ansible deployment
|
||||||
run: ansible-playbook -i ansible/inventory.yaml site.yaml
|
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
|
||||||
Reference in New Issue
Block a user