Remote execution tasks using scripts fail, whereas remote execution tasks using Ansible roles/playbooks complete successfully for the same host(s)

Solution Verified - Updated -

Issue

  • Remote execution jobs using Ansible roles/playbooks complete successfully, whereas remote execution jobs using script and run against the same host(s) fail with the following error:

    Output:
    \---
    proxy_task_id: 99557edd-8c01-4974-b2c6-60ae18d042a0
    proxy_output:
    result:
    - output_type: debug
      output: "Error initializing command: RuntimeError - Could not establish connection
        to remote host using any available authentication method, tried publickey\n\nAuthentication
        method 'publickey' failed with:\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@
        \   WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nIT
        IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\r\nSomeone could be eavesdropping
        on you right now (man-in-the-middle attack)!\r\nIt is also possible that a host
        key has just been changed.\r\nThe fingerprint for the ECDSA key sent by the
        remote host is\nSHA256:5ZRN7em1Zg180A+RHjcr1QHiDCUIriRVzHcGsaA7iuY.\r\nPlease
        contact your system administrator.\r\nAdd correct host key in /usr/share/foreman-proxy/.ssh/known_hosts
        to get rid of this message.\r\nOffending ECDSA key in /usr/share/foreman-proxy/.ssh/known_hosts:25\r\nECDSA
        host key for host.example.com has changed and you have requested strict checking.\r\nHost
        key verification failed.\r\n"
      timestamp: 1723718281.6434834
      runner_id: bd1c00ad-623c-4ce0-bb1b-7779d060cdcc
    exit_status: EXCEPTION
    
  • Satellite task details for the host in question shows the below error:

    Error initializing command: RuntimeError - Could not establish connection to remote host using any available authentication method, tried password, publickey
    2:
    
    3:
    Authentication method 'password' failed with:
    4:
    Exiting, you have requested strict checking.
    5:
    Host key verification failed.
    6:
    
    7:
    Authentication method 'publickey' failed with:
    8:
    Exiting, you have requested strict checking.
    9:
    Host key verification failed.
    10:
    Exit status: EXCEPTION
    11:
    StandardError: Job execution failed
    

Environment

  • Red Hat Satellite 6.15.2
  • Red Hat Satellite 6.15.3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content