Refactor SSH configuration in ansible-apply.yaml and add trusted hosts

This commit is contained in:
2024-09-24 17:02:55 +02:00
parent c01cc05b28
commit 8c4017ba45
+5 -3
View File
@@ -35,11 +35,13 @@ jobs:
chmod 600 ~/.ssh/id_rsa
- name: Configure SSH to Disable Host Key Checking
env:
TRUSTE_HOSTS: ${{ secrets.TRUSTED_HOSTS }}
run: |
mkdir -p ~/.ssh
touch ~/.ssh/config
echo -e "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null\n" >> ~/.ssh/config
chmod 600 ~/.ssh/config
for host in $TRUSTED_HOSTS; do
ssh-keyscan -H $host >> ~/.ssh/known_hosts
done
- name: Apply Ansible Playbook
env: