Skip to content

Commit

Permalink
final test
Browse files Browse the repository at this point in the history
...
  • Loading branch information
MementoMori11723 committed Dec 14, 2024
1 parent 5e0a688 commit 22ea38e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@ jobs:
sudo apt update
sudo apt install -y ansible openssh-client
- name: Generate SSH key pair for Ansible
- name: Add SSH private key for Ansible
run: |
mkdir -p ~/.ssh
ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa -N ""
echo "${{ secrets.VPS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Add VPS public key to authorized_keys (for testing, ideally do this manually on your VPS)
run: |
echo "${{ secrets.VPS_SSH_PUBLIC_KEY }}" >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
- name: Create dynamic inventory.ini
run: |
mkdir -p ansible # Ensure the ansible directory exists
Expand All @@ -44,6 +39,4 @@ jobs:
chmod 644 ~/.ssh/known_hosts
- name: Run Ansible playbook
run: |
export ANSIBLE_SSH_ARGS="-v"
ansible-playbook ansible/playbook.yml -i ansible/inventory.ini
run: ansible-playbook ansible/playbook.yml -i ansible/inventory.ini

0 comments on commit 22ea38e

Please sign in to comment.