ansible-collections / dellemc.enterprise_sonic

Ansible Network Collection for Enterprise SONiC Distribution by Dell Technologies
GNU General Public License v3.0
43 stars 61 forks source link

[BUG]: Can not set Port speed via ansible using sonic_interfaces module #467

Open TafkaMax opened 1 week ago

TafkaMax commented 1 week ago

Bug Description

I wish to set the speed of the interfaces via the interfaces module: the https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_interfaces_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-interfaces-module

But my ansible is returning this error.

FAILED! => {"changed": false, "msg": "Unable to configure speed in port group member. Please use port group module to change the speed"}

You can set the speed via CLI - so it should be supported.

Example from CLI:

#output from show interface status
Ethernet11          -                             down           admin-down     off       10000          9100           Eth1/12
switch# configure terminal
switch(config)# interface Ethernet 11
switch(config-if-Ethernet11)# speed 1000
switch(config-if-Ethernet11)# end
switch# show interface status
Ethernet11          -                             down           admin-down     off       1000           9100           Eth1/12

Product Name

Dell Enterprise Sonic

Component or Module Name

httpapi

DellEMC Enterprise SONiC Ansible Collection Version

main branch from commit 26157a2f5cb58fb780ba9dbbf0edb8ae832b707a

SONiC Software Version

Software Version : 4.4.0-Enterprise_Standard

Configuration

CONFIG_FILE() = /home/tansper/ansible/ansible.cfg
DEFAULT_HOST_LIST(/home/tansper/ansible/ansible.cfg) = ['/home/tansper/ansible/hosts']
DEFAULT_LOOKUP_PLUGIN_PATH(/home/tansper/ansible/ansible.cfg) = ['/home/tansper/ansible/plugins/lookup']
DEFAULT_VAULT_PASSWORD_FILE(/home/tansper/ansible/ansible.cfg) = /home/tansper/ansible/scripts/vault_password.sh
EDITOR(env: EDITOR) = vim
HOST_KEY_CHECKING(/home/tansper/ansible/ansible.cfg) = False
PAGER(env: PAGER) = less

Steps to Reproduce

Do this on a 10GB port for example.

- name: Configure interfaces
  sonic_interfaces:
    config:
      - name: Ethernet1
        speed: SPEED_1GB
    state: merged

Expected Behavior

You can set the speed of the interface via the API.

Actual Behavior

It shows an error to use the port_group API

Logs

FAILED! => {"changed": false, "msg": "Unable to configure speed in port group member. Please use port group module to change the speed"}

Screenshots

No response

Additional Information

No response

TafkaMax commented 3 days ago

The change in #470 worked. Thank you for the quick response!