[英]Error when I am trying to execute show version into a Cisco device
I am trying to learn Ansible but I have some problems: I did a simple playbook, my first one, but it didn't work well: I am able to connect to my device with user teste
and password teste
and also execute the command.我正在尝试学习 Ansible 但我有一些问题:我做了一个简单的剧本,我的第一个,但效果不佳:我可以使用用户
teste
和密码teste
连接到我的设备并执行命令。
fatal: [ansible_user=teste]: FAILED: => {"changed", false: "msg", "command timeout triggered. timeout value is 10 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide:"} fatal: [ansible_password=teste]: FAILED, => {"changed": false, "msg".
致命:[ansible_user=teste]: FAILED: => {"changed", false: "msg", "命令超时触发。超时值为 10 秒。\n请参阅网络调试和故障排除指南中的超时设置选项:"}致命的:[ansible_password=teste]:失败,=> {“更改”:假,“味精”。 "command timeout triggered. timeout value is 10 secs:\nSee the timeout setting options in the Network Debug and Troubleshooting Guide."} fatal.
“命令超时已触发。超时值为 10 秒:\n请参阅《网络调试和故障排除指南》中的超时设置选项。”} 致命。 [192.168:0:103], FAILED: => {"changed", false.
[192.168:0:103],失败:=> {“已更改”,错误。 "msg".
“味精”。 "command timeout triggered, timeout value is 10 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide."}
"命令超时触发,超时值为 10 秒。\n请参阅网络调试和故障排除指南中的超时设置选项。"}
This is my playbook:这是我的剧本:
---
- name: First Play
hosts: routers
gather_facts: False
connection: local
tasks:
- name: Fist Task
ios_command:
commands: show version
register: version
Do you have any idea of what I am doing wrong?你知道我做错了什么吗?
well, I have to change my host file:好吧,我必须更改我的主机文件:
this way did not work:这种方式不起作用:
[routers]
192.168.0.103
ansible_user=teste
ansible_password=teste
after check in the internet, I tried this way and worked fine:在互联网上检查后,我尝试了这种方式并且工作正常:
[routers]
192.168.0.103
[routers:vars]
ansible_user=teste
ansible_password=teste
ansible_connection=network_cli
ansible_network_os=ios
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.