Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Troubleshooting Ansible Authentication Errors When Managing Devices Running Junos OS

 

Problem:

Description:

During execution of a Juniper.junos module, the Ansible control machine generates a ConnectAuthError error for failed authentication. For example:

Cause

The device running Junos OS might fail to authenticate the user for the following reasons:

  • The user does not an have an account on the device running Junos OS.

  • The user has an account with a text-based password configured on the device running Junos OS, but the wrong password or no password is supplied for the user when executing the module.

  • The user has an account on the device running Junos OS with SSH keys configured, but the SSH keys are inaccessible on either the device or the control machine.

Note

The Ansible core modules for Junos OS might generate an “unable to open shell” error for this and other reasons. For more information, see https://docs.ansible.com/ansible/latest/network_debug_troubleshooting.html#unable-to-open-shell.

Solution

Ensure that the user executing the Ansible for Junos OS modules has a Junos OS login account on all target devices running Junos OS and that an SSH public/private key pair or text-based password is configured for the account. If SSH keys are configured, verify that the user can access them.