TASK [Gathering Facts] ************************************************************************************************************************************************
fatal: [vegeta01_temp]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: \n****************************************************************************Permission denied (publickey,password,keyboard-interactive).", "unreachable": true}
---
- name: nxos_facts module
hosts: vegeta_core
vars:
ssh:
host: “{{ansible_host}”
username: “{{vegeta}”
password: “{{abc123}”
nxapi:
host: "{{ ansible_host }}"
username: "{{ vegeta }}”
password: "{{ abc123 }}"
transport: nxapi
use_ssl: no
validate_certs: no
port: 80
tasks:
- name: nxos_facts ssh
nxos_facts:
provider: "{{ssh}}"
- name: nxos_facts nxapi
nxos_facts:
provider: "{{ nxapi }}"
ansible 2.7.8
config file = /etc/ansible/ansible.cfg
configured module search path = ['/usr/share/ansible']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.8 (default, Feb 22 2019, 12:24:32) [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)]
[root@ansiblevm ansible]#
cat ansible.cfg | grep -v "#"
[defaults]
library = /usr/share/ansible/
remote_tmp = $HOME/.ansible/tmp
forks = 5
timeout = 10
log_path = /var/log/ansible.log
[inventory]
[privilege_escalation]
[paramiko_connection]
[ssh_connection]
[persistent_connection]
[accelerate]
[selinux]
[colors]
[diff]
ok fixed the username and password and I am still not able to login using the playbook
vegeta01_temp | UNREACHABLE! => {
"changed": false,
"msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1551117540.2506652-80180766644234 `\" && echo ansible-tmp-1551117540.2506652-80180766644234=\"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1551117540.2506652-80180766644234 `\" ), exited with result 16, stdout output: Syntax error while parsing '/bin/sh -c '( umask 77 && mkdir -p \"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1551117540.2506652-80180766644234 `\" && echo ansible-tmp-1551117540.2506652-80180766644234=\"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1551117540.2506652-80180766644234 `\" ) && sleep 0''\n\n\nCmd exec error.\n",
"unreachable": true
}
vegeta02_temp | UNREACHABLE! => {
"changed": false,
"msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1551117540.287293-48560425026336 `\" && echo ansible-tmp-1551117540.287293-48560425026336=\"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1551117540.287293-48560425026336 `\" ), exited with result 16, stdout output: Syntax error while parsing '/bin/sh -c '( umask 77 && mkdir -p \"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1551117540.287293-48560425026336 `\" && echo ansible-tmp-1551117540.287293-48560425026336=\"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1551117540.287293-48560425026336 `\" ) && sleep 0''\n\n\nCmd exec error.\n",
"unreachable": true
}
[root@ansiblevm ansible]#
TASK [show version] ***************************************************************************************************************************************************
fatal: [vegetacore01_temp]: FAILED! => {"msg": "Invalid/incorrect username/password. Private key file is encrypted"}
fatal: [vegetacore02_temp]: FAILED! => {"msg": "Invalid/incorrect username/password. Private key file is encrypted"}
---
- name: INE_NXOS
hosts: sjc_core
connection: local
vars:
cli:
host: "{{ inventory_hostname }}"
username: vegeta
password: abc123
transport: cli
tasks:
- name: show version
nxos_command:
commands: show version
provivder: "{{ cli }}"