cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
527
Views
0
Helpful
1
Replies

Ansible - Cisco Nexus Access Verification

Netmart
Level 1
Level 1

Hello,

When I am trying to ping the managed nodes via Ansible I receive and access verification error.

Prior to that test I was able to successfully SSH into Nexus via Ansible host

ubuntu@Ansible:~/.ssh$ ssh 192.168.3.1

User Access Verification

Password:

Cisco NX-OS Software

 

ubuntu@Ansible:~$ sudo nano /etc/ansible/hosts

[sudo] password for ubuntu:

[CiscoNode]

192.168.3.1

192.168.3.2

192.168.3.3

192.168.3.4

 

ubuntu@Ansible:~$ ansible all -m ping

192.168.3.1 | UNREACHABLE! => {

    "changed": false,

    "msg": "Failed to connect to the host via ssh: User Access Verification\nubuntu@192.168.3.1: Permission denied (publickey,password,keyboard-interactive).",

    "unreachable": true

}

Please advise.

 

Thanks,

Netmart

1 Reply 1

Alex Stevenson
Cisco Employee
Cisco Employee

Hello @Netmart,

 

Try these:

 

1. In the /etc/ansible/hosts file, prepend the ip address with your username, e.g ubuntu@192.168.3.1

 

2. Change your inventory file to include:

ansible_user

ansible_ssh_pass

ansible_ssh_user

 

...and issue this command:

ansible webserver --private-key pem_file.pem -m ping (optionally with -vvvv)

 

3. The public key for root must be on the destination, not just the public key from the non-root user. Try this first before your individual ping:

sudo ansible -m ping all

 

4. Mention the username in /etc/hosts file

ip_address ansible_user="username for remote pc"