I am trying to use SSH pass to authenticate and then run a playbook via GitHub Actions (GHA) and am encountering the following error:
encountered an authentication error fatal: [airflowdev]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '10.1X.29.7X' (ED25519) to the list of known hosts.\r\n\n USE OF THIS COMPUTING SYSTEM IS RESTRICTED TO THE CONDUCT OF COMPANY\n BUSINESS BY AUTHORIZED USERS. ALL INFORMATION AND COMMUNICATIONS ON THIS\n SYSTEM ARE SUBJECT TO REVIEW, MONITORING, AND RECORDING AT ANY TIME\n WITHOUT NOTICE. UNAUTHORIZED ACCESS OR USE MAY BE SUBJECT TO PROSECUTION.\n\ninfogrid@10.1X.29.7X: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}
The GHA Workflow
name: ansiblePOC
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
ANSIBLE_PASSWORD: ${{ secrets.ANSIBLE_AIRFLOW_DEV }}
jobs:
deploy_dags:
runs-on: [ self-hosted, linux ]
container:
image: ansible-poc:latest
credentials:
username: ${{ secrets.ARTIFACTORY_USER }}
password: ${{ secrets.ARTIFACTORY_PAT }}
env:
ANSIBLE_PASSWORD: ${{ env.ANSIBLE_PASSWORD }}
ANSIBLE_REMOTE_USER: infogrid
ANSIBLE_HOST_KEY_CHECKING: False
ANSIBLE_DEBUG: true
volumes:
- ./ansisble/fake_dags:/fake_dags
- ./ansisble/inventory:/inventory
- ./ansisble/playbooks:/playbooks
steps:
- name: Pulling files from repository to GitHub runner
uses: actions/checkout@v4
- name: Deploy DAGs
run: ansible-playbook -i ./ansible/inventory/hosts.yml ./ansible/playbooks/fakedagdeploy.yml
The Inventory File
airflowservers:
hosts:
airflowdev:
ansible_host: 10.1X.29.7X
The Playbook
- name: fakedagdeployment
hosts: airflowdev
become: true
tasks:
- name: deploy fake dags
ansible.posix.synchronize:
src: /fake_dags
dest: /home/infogrid/cp_test_ansible
delete: true
recursive: true
Thank you for your help!