我必须使用 ansible 在我的基础设施中执行一些网络自动化。
当我尝试将 ansible 模块用于 icx 开关时,它似乎行为不端。
我用的剧本
---
- name: ICX switch testing
hosts: test-switch
gather_facts: no
vars:
ansible_user: username
ansible_password: password
ansible_connection: ansible.netcommon.network_cli
ansible_network_os: icx
tasks:
- name: show version
icx_command:
commands:
- show version
为此,我遇到了错误
FAILED! => {"changed": false, "msg": "skip\r\nInvalid input -> skip\r\nType ? for a list\r\nSSH@ICX7250-24P Switch>"}
当我使用 ansible_become 使用启用模式时,它会给出以下错误
FAILED! => {"changed": false, "msg": "unable to elevate privilege to enable mode, at prompt [None] with error: timeout value 60 seconds reached while trying to send command: b'enable'"}
我不确定为什么命令 enable 更改为b'enable
. 模块似乎有些问题
版本
ansible 2.9.9
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.8 (default, Sep 26 2019, 11:57:09) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]