简体   繁体   English

当我尝试在 Cisco 设备中执行 show version 时出错

[英]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.

相关问题 如何使用 ansible 从 show version (cisco ios) 解析元数据 - How can I parse metadata from show version (cisco ios) using ansible 当我尝试运行创建 ec2 安全组的 ansible playbook 时出现错误 - I am getting an error when I am trying to runn ansible playbook that creates a ec2 security group 在准备连接到Cisco设备期间出现ssh错误 - ansible ssh error during pre ping to cisco device 尝试让 ansible 删除 cisco 路由器上的文件时超时 - Timeout when trying to have ansible delete a file on cisco routers 当我执行剧本时,出现以下错误 - When I execute playbook, getting the following error 与Cisco设备的Ansible Python API连接 - Ansible Python API connection to Cisco device 思科 ansible 显示运行配置 - Cisco ansible show running-config 我正在尝试使用 ansible 剧本安装 helm,但在创建 RBAC 配置时出现错误 - I am trying to install helm using the ansible playbook but i have an error while creating RBAC configuration 我正在尝试从 Ansible 模块的以下 json 输出中获取 cpucapacity/cpuused 值,但出现空白消息或错误 - I am trying to get the cpucapacity/cpuused value from the below json output from Ansible module am getting blank msg or error 尝试安装wire-server/ansible时出现此错误 - I have this error when trying to install wire-server/ansible
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM