Refactor SSH configuration in ansible-apply.yaml and fix trusted hosts
This commit is contained in:
@@ -37,14 +37,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Configure SSH to Disable Host Key Checking
|
- name: Configure SSH to Disable Host Key Checking
|
||||||
env:
|
env:
|
||||||
TRUSTE_HOSTS: ${{ secrets.TRUSTED_HOSTS }}
|
TRUSTED_HOSTS: ${{ secrets.TRUSTED_HOSTS }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
touch ~/.ssh/known_hosts
|
|
||||||
for host in $TRUSTED_HOSTS; do
|
for host in $TRUSTED_HOSTS; do
|
||||||
ssh-keyscan $host >> ~/.ssh/known_hosts
|
ssh-keyscan $host >> ~/.ssh/known_hosts
|
||||||
done
|
done
|
||||||
cat ~/.ssh/known_hosts
|
|
||||||
chmod 600 ~/.ssh/known_hosts
|
chmod 600 ~/.ssh/known_hosts
|
||||||
|
|
||||||
- name: Apply Ansible Playbook
|
- name: Apply Ansible Playbook
|
||||||
|
|||||||
Reference in New Issue
Block a user