Hello Everyone,
I am newbie for Ansible and I studying some features in
order to do implementation based first of all to get specific configuration
from Cisco Router, because after that if I can understand whole process to
access those devices I will increase more task inside my playbook to make
order configuration and so on.
I am using Ubuntu based in ppa:ansible/ansible installation
which is using Python version 2.7.12.
ansible 2.3.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0
20160609]
I make my specific hosts file and copy to different folder
to execute playbook and not impact default installation. However, I am
keeping receiving the message failure to access those device via playbook.
I attached logs of playbook execution in two instance:
1. Running playbook which I have error always make log try to log on
device via root, however I giving parameters to use user/password
2. Ruuning specific -raw to verify authentication is working and result
is OK
So, where are problems? Is there someone to help understand those problems.
Kind Regards,
Rodrigo
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/000801d2be0e%2485d6c470%2491844d50%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
root@ubuntu:/home/rodrigo/Documents/ansible# ansible-playbook -i hosts -u
rodrigo backup_cisco_router.yaml -k -vvv
Using /home/rodrigo/Documents/ansible/ansible.cfg as config file
SSH password:
PLAYBOOK: backup_cisco_router.yaml
***********************************************************************************************************
1 plays in backup_cisco_router.yaml
PLAY [routers]
*******************************************************************************************************************************
META: ran handlers
TASK [OBTAIN LOGIN CREDENTIALS]
**************************************************************************************************************
task path: /home/rodrigo/Documents/ansible/backup_cisco_router.yaml:7
ok: [192.168.0.13] => {
"ansible_facts": {
"creds": {
"auth_pass": "rodrigo",
"password": "rodrigo",
"username": "rodrigo"
}
},
"changed": false
}
ok: [192.168.0.20] => {
"ansible_facts": {
"creds": {
"auth_pass": "rodrigo",
"password": "rodrigo",
"username": "rodrigo"
}
},
"changed": false
}
TASK [Define provider]
***********************************************************************************************************************
task path: /home/rodrigo/Documents/ansible/backup_cisco_router.yaml:10
ok: [192.168.0.13] => {
"ansible_facts": {
"provider": {
"auth_pass": "rodrigo",
"host": "192.168.0.13",
"password": "rodrigo",
"username": "rodrigo"
}
},
"changed": false
}
ok: [192.168.0.20] => {
"ansible_facts": {
"provider": {
"auth_pass": "rodrigo",
"host": "192.168.0.20",
"password": "rodrigo",
"username": "rodrigo"
}
},
"changed": false
}
TASK [show run]
******************************************************************************************************************************
task path: /home/rodrigo/Documents/ansible/backup_cisco_router.yaml:18
Using module file
/usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_command.py
<192.168.0.13> ESTABLISH LOCAL CONNECTION FOR USER: root
<192.168.0.13> EXEC /bin/sh -c 'echo ~ && sleep 0'
<192.168.0.13> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo
/root/.ansible/tmp/ansible-tmp-1493156957.4-215106377118156 `" && echo
ansible-tmp-1493156957.4-215106377118156="` echo
/root/.ansible/tmp/ansible-tmp-1493156957.4-215106377118156 `" ) && sleep 0'
<192.168.0.13> PUT /tmp/tmpMl0yqC TO
/root/.ansible/tmp/ansible-tmp-1493156957.4-215106377118156/ios_command.py
<192.168.0.13> EXEC /bin/sh -c 'chmod u+x
/root/.ansible/tmp/ansible-tmp-1493156957.4-215106377118156/
/root/.ansible/tmp/ansible-tmp-1493156957.4-215106377118156/ios_command.py &&
sleep 0'
<192.168.0.13> EXEC /bin/sh -c '/usr/bin/python
/root/.ansible/tmp/ansible-tmp-1493156957.4-215106377118156/ios_command.py; rm
-rf "/root/.ansible/tmp/ansible-tmp-1493156957.4-215106377118156/" > /dev/null
2>&1 && sleep 0'
fatal: [192.168.0.13]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
===========================
root@ubuntu:/home/rodrigo/Documents/ansible# ansible -i hosts 192.168.0.13 -u
rodrigo -m raw -a "ping 192.168.0.1" -c ssh -vvv -k
Using /home/rodrigo/Documents/ansible/ansible.cfg as config file
SSH password:
META: ran handlers
<192.168.0.13> ESTABLISH SSH CONNECTION FOR USER: rodrigo
<192.168.0.13> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o
ControlPersist=60s -o StrictHostKeyChecking=no -o User=rodrigo -o
ConnectTimeout=5 -o ControlPath=/root/.ansible/cp/e5041b4ba8 -tt 192.168.0.13
'ping 192.168.0.1'
<192.168.0.13> (0, '\r\nType escape sequence to abort.\r\nSending 5, 100-byte
ICMP Echos to 192.168.0.1, timeout is 2 seconds:\r\n!!!!!\r\nSuccess rate is
100 percent (5/5), round-trip min/avg/max = 1/1/2 ms', 'Connection to
192.168.0.13 closed by remote host.\r\nShared connection to 192.168.0.13
closed.\r\n')
192.168.0.13 | SUCCESS | rc=0 >>
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 msConnection
to 192.168.0.13 closed by remote host.
Shared connection to 192.168.0.13 closed.
META: ran handlers
META: ran handlers