SSH Pass Authentication Error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true

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!

Are you trying to run a job with git runner on the ansible-host that will connect to the ansible-host with ansible?

Since IP is masked, if you want to run the job locally (i only know gitlab runner), you should change the inventory to localhost and ansible_connection=local. Then it will not try to connect to itself with ssh.

If you are trying to run a playbook from one server to another server with ansible, i would move the all the credentials to groups_vars or host_vars and encrypt it with vault.

Or store the password in a git variable in you git (this works with gitlab) and run the command with --ask-become-pass and have that variable to be prompted after (if that works),