-1

我正在尝试使用 Ansible 向我的 Cisco ASA 发送“显示版本”命令,但遇到以下错误,我不知道为什么。不过,同样的事情适用于我的 Cisco 路由器。以下是一些可能有用的细节。

Cisco Asa version -> 9.12(2)9

Ansible version -> 2.9.13 

Python version -> 2.7.17

Ansible 主机:

#This is a group of remote servers with GUI
[gui]
ubuntu ansible_user=admin

#These are global variables for the group Cisco
[cisco:vars]
ansible_connection=local
ansible_network_os=ios

#This is a group of remote servers for Cisco devices
[cisco]
cisco_router ansible_user=admin

[firewall:vars]
ansible_connection=local

[firewall]
cisco_asa ansible_user=admin

阿萨剧本:

- name: "Connecting to Cisco ASA"
hosts: firewall
  gather_facts: no
  tasks:
    - name: run show version on remote devices
      cisco.asa.asa_command:
        commands:
          - show version

遇到错误:

fatal: [cisco_asa]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "Unsupported parameters for (cisco.asa.asa_command) module: context, passwords found in provider. Supported parameters include: auth_pass, authorize, host, password, port, ssh_keyfile, timeout, username"}

-vvv 完全错误:

fatal: [cisco_asa]: FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"invocation": {
"module_args": {
"authorize": null,
"commands": [
"show version"
],
"context": null,
"interval": 1,
"match": "all",
"passwords": null,
"provider": {
"auth_pass": null,
"authorize": false,
"context": null,
"host": null,
"password": null,
"passwords": null,
"port": null,
"ssh_keyfile": null,
"timeout": null,
"username": null
},
"retries": 10,
"wait_for": null
}
},
"msg": "Unsupported parameters for (cisco.asa.asa_command) module: context, passwords found in provider. Supported parameters include: auth_pass, authorize, host, password, port, ssh_keyfile, timeout, username"
}

有人可以帮帮我吗?

4

1 回答 1

3

在我的主机文件中使用以下变量并使用 pip 命令安装 paramiko 为我解决了这个问题:

ansible_user=admin
ansible_ssh_pass=*****
ansible_become_method=enable
ansible_become_pass=*****
ansible_connection=ansible.netcommon.network_cli
ansible_network_os=cisco.asa.asa
ansible_python_interpreter=python
于 2020-09-30T16:31:05.097 回答