From b14cfdbc3f7c4805e81750e13dd80b683979faec Mon Sep 17 00:00:00 2001 From: Alexandre Pires Date: Tue, 24 Sep 2024 16:56:41 +0200 Subject: [PATCH] Refactor ansible-apply.yaml to configure SSH and disable host key checking --- .github/workflows/ansible-apply.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ansible-apply.yaml b/.github/workflows/ansible-apply.yaml index f9bcad1..50e5e85 100644 --- a/.github/workflows/ansible-apply.yaml +++ b/.github/workflows/ansible-apply.yaml @@ -34,11 +34,17 @@ jobs: cp ssh-keys/ansible/id_rsa ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa + - name: Configure SSH to Disable Host Key Checking + run: | + mkdir -p ~/.ssh + touch ~/.ssh/config + echo -e "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null\n" >> ~/.ssh/config + chmod 600 ~/.ssh/config + - name: Apply Ansible Playbook env: VAULT_MASTER_PASSWORD: ${{ secrets.VAULT_MASTER_PASSWORD }} ANSIBLE_USER: ${{ secrets.ANSIBLE_USER }} - ANSIBLE_HOST_KEY_CHECKING: False run: | cd ansible sectool exec ansible-playbook -i inventory/hosts playbook_microk8s.yml