Unable to execute ansible-playbook and ansible ad-hoc commands

Solution Verified - Updated -

Issue

  • The ansible-playbook is failing during Gathering Facts
TASK [Gathering Facts] *************************************************************************************************************************
Wednesday 26 March 2020  12:00:00 +0000 (0:00:00.058)       0:00:00.776 *******
fatal: [node1.example.com]: FAILED! => {"msg": "Timeout (32s) waiting for privilege escalation prompt: "}
  • It is not possible to access nodes with ansible ad-hoc commands
$ ansible all -i /etc/ansible/hosts -m ping
Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa': 
Enter passphrase for key '/root/.ssh/id_rsa':
Enter passphrase for key '/root/.ssh/id_rsa':
Enter passphrase for key '/root/.ssh/id_rsa':

node1.example.com | FAILED! => {
    "msg": "Timeout (32s) waiting for privilege escalation prompt: "
}

node2.example.com | FAILED! => {
    "msg": "Timeout (32s) waiting for privilege escalation prompt: "
}
  • The SSH key file is protected by a passphrase
  • The ansible_ssh_user is not root as default
  • Ansible is using the wrong root's SSH key instead of the ansible ssh user key

Environment

  • OpenShift Container Platform
    • 3.11

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