My Mellanox task role:
---
- name: set mellanox
set_fact:
ansible_network_os: 'onyx'
ansible_connection: network_cli
- name: configure interface Eth1/2
mellanox.onyx.onyx_interface:
name: Eth1/2
mtu: 1500
My playbook:
---
- hosts: mellanox_switch
gather_facts: no
roles:
- mellanox
The error (verbose 3) it produces:
The full traceback is:
File "/tmp/ansible_mellanox.onyx.onyx_interface_payload_8h8n_8qc/ansible_mellanox.onyx.onyx_interface_payload.zip/ansible_collections/mellanox/onyx/plugins/module_utils/network/onyx/onyx.py", line 158, in get_capabilities
capabilities = connection.get_capabilities()
File "/tmp/ansible_mellanox.onyx.onyx_interface_payload_8h8n_8qc/ansible_mellanox.onyx.onyx_interface_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
fatal: [192.168.1.4]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"aggregate": null,
"delay": 10,
"description": null,
"enabled": null,
"mtu": 1500,
"name": "Eth1/2",
"purge": false,
"rx_rate": null,
"speed": null,
"state": "present",
"tx_rate": null
}
},
"msg": "show version | json-print\r\r\n% Unrecognized command \"json-print\".\r\nType \"?\" for help.\r\n\r [standalone: master] > "
}
What is odd, is that the onyx_command module works just fine:
---
# Mellanox management
- name: set mellanox
set_fact:
ansible_network_os: 'onyx'
ansible_connection: network_cli
- name: test show version
onyx_command:
commands: show version
Not sure what the issue is. Thinking it might be installation related.