diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index eac624f..5b3b0f9 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -10,9 +10,14 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Set up SSH Key + run: | + mkdir -p ~/.ssh + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + echo "StrictHostKeyChecking no" >> ~/.ssh/config + - name: Run Ansible Playbook - env: - ANSIBLE_NETCONF_PASSWORD: ${{ secrets.WINRM_PASSWORD }} run: | cd ansible ansible-playbook -i inventory.ini playbook.yml \ No newline at end of file diff --git a/ansible/inventory.ini b/ansible/inventory.ini index 3c2162e..84abeb6 100644 --- a/ansible/inventory.ini +++ b/ansible/inventory.ini @@ -2,8 +2,7 @@ GUFK_ISERVER ansible_host=192.168.1.2 [windows:vars] -ansible_user=admin@efgufk.com -ansible_password=Sj032ssa! -ansible_connection=winrm -ansible_winrm_server_cert_validation=ignore -ansible_port=5985 \ No newline at end of file +ansible_user=admin +ansible_connection=ssh +ansible_shell_type=cmd +ansible_ssh_private_key_file=~/.ssh/id_ed25519 \ No newline at end of file