Closed shoneslab closed 4 months ago
Hi Shone,
Please send the output from running the failing playbook in 'verbose' mode.
e.g.
ansible-playbook -i \<inventory file path> \<playbook path> -vvvv
Kerry Meyer
TASK [Set interface down] ** task path: /opt/automation/playbooks/airgap-management.yml:25 redirecting (type: action) dellemc.enterprise_sonic.sonic_interfaces to dellemc.enterprise_sonic.sonic redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli redirecting (type: action) dellemc.enterprise_sonic.sonic_interfaces to dellemc.enterprise_sonic.sonic redirecting (type: action) dellemc.enterprise_sonic.sonic_interfaces to dellemc.enterprise_sonic.sonic redirecting (type: action) dellemc.enterprise_sonic.sonic_interfaces to dellemc.enterprise_sonic.sonic redirecting (type: action) dellemc.enterprise_sonic.sonic_interfaces to dellemc.enterprise_sonic.sonic redirecting (type: action) dellemc.enterprise_sonic.sonic_interfaces to dellemc.enterprise_sonic.sonic redirecting (type: action) dellemc.enterprise_sonic.sonic_interfaces to dellemc.enterprise_sonic.sonic The full traceback is: File "/opt/automation/collections/ansible_collections/dellemc/enterprise_sonic/plugins/module_utils/network/sonic/facts/interfaces/interfaces.py", line 55, in get_all_interfaces response = edit_config(self._module, to_request(self._module, request)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/automation/collections/ansible_collections/dellemc/enterprise_sonic/plugins/module_utils/network/sonic/sonic.py", line 139, in edit_config return connection.edit_config(commands) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/ansible/module_utils/connection.py", line 199, in rpc raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code) fatal: [sonic_switch_01]: FAILED! => { "changed": false, "code": -32603, "invocation": { "module_args": { "config": [ { "advertised_speed": null, "auto_negotiate": null, "description": null, "enabled": true, "fec": null, "mtu": null, "name": "Ethernet12", "speed": null } ], "state": "replaced" } }, "msg": "'command'" } The full traceback is: File "/opt/automation/collections/ansible_collections/dellemc/enterprise_sonic/plugins/module_utils/network/sonic/facts/interfaces/interfaces.py", line 55, in get_all_interfaces response = edit_config(self._module, to_request(self._module, request)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/automation/collections/ansible_collections/dellemc/enterprise_sonic/plugins/module_utils/network/sonic/sonic.py", line 139, in edit_config return connection.edit_config(commands) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/ansible/module_utils/connection.py", line 199, in rpc raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code) fatal: [sonic_switch_02]: FAILED! => { "changed": false, "code": -32603, "invocation": { "module_args": { "config": [ { "advertised_speed": null, "auto_negotiate": null, "description": null, "enabled": true, "fec": null, "mtu": null, "name": "Ethernet12", "speed": null } ], "state": "replaced" } }, "msg": "'command'" }
The following two corrections are required for this playbook to make it work as intended:
The resulting revised playbook would look like this:
(Changed and added lines are marked by '<<<' to annotate them.)
---
- name: Manage Sonic Switch Interfaces
hosts: vault_cleanroom_switches
gather_facts: no
connection: httpapi <<< (Add this.)
collections:
- dellemc.enterprise_sonic
tasks:
- name: Set interface down
sonic_interfaces: <<< correct indentation; shorten to module name
config: <<< recommended: indent these remaining lines by one more space
- name: Ethernet12
enabled: True
state: replaced
I am closing this issue because the playbook that generated the problem symptoms had problems in the YAML syntax. With a revised version of an equivalent playbook, the operation executes successfully using the current released version of the Dell enterprise_sonic Ansible resource module collection.
Bug Description
I am trying make the sonic ethernet interfaces interfaces up/down using the module and getting the error:
Playbook
Inventory File
Product Name
Dell Enterprise Sonic Ansible Module
Component or Module Name
dellemc.enterprise_sonic.sonic_interfaces
DellEMC Enterprise SONiC Ansible Collection Version
v2.4.0
SONiC Software Version
Enterprise Sonic 4.2.1 on GNS3 2.2.47
Configuration
ansible version
Steps to Reproduce
Execute the playbook.
Expected Behavior
Playbook should exit successfully by making the interface enabled with status up
Actual Behavior
Logs
Screenshots
No response
Additional Information
No response