ansible-collections / dellemc.enterprise_sonic

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

[BUG]: bgp max med on startup mandates optional Max MED value attribute as mandatory #416

Closed avinothcgl closed 3 months ago

avinothcgl commented 4 months ago

Bug Description

bgp max med on startup mandates optional Max MED value attribute as mandatory

In sonic cli after startup timer there is carriage return option but ansible collection expects to put max med value as well

`Z9264-11(config-router-bgp)# max-med on-startup 420 ? <0..4294967295> Max MED value to be used

` `linuxadmin@vm2-services:~/Automation/Ansible/testing$ ansible-playbook -i inventory.ini bgp-playbook.yaml -vvv ansible-playbook [core 2.12.0] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/linuxadmin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/linuxadmin/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-playbook python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] jinja version = 3.0.3 libyaml = True Using /etc/ansible/ansible.cfg as config file host_list declined parsing /home/linuxadmin/Automation/Ansible/testing/inventory.ini as it did not pass its verify_file() method script declined parsing /home/linuxadmin/Automation/Ansible/testing/inventory.ini as it did not pass its verify_file() method auto declined parsing /home/linuxadmin/Automation/Ansible/testing/inventory.ini as it did not pass its verify_file() method yaml declined parsing /home/linuxadmin/Automation/Ansible/testing/inventory.ini as it did not pass its verify_file() method Parsed /home/linuxadmin/Automation/Ansible/testing/inventory.ini inventory source with ini plugin redirecting (type: action) dellemc.enterprise_sonic.sonic_bgp to dellemc.enterprise_sonic.sonic Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: bgp-playbook.yaml **************************************************************************************************************************************************************************************************************** 1 plays in bgp-playbook.yaml PLAY [Ansible Enterprise SONiC BGP resource module] **************************************************************************************************************************************************************************************** META: ran handlers redirecting (type: action) dellemc.enterprise_sonic.sonic_bgp to dellemc.enterprise_sonic.sonic TASK [Configure BGP Global attributes] ***************************************************************************************************************************************************************************************************** task path: /home/linuxadmin/Automation/Ansible/testing/bgp-playbook.yaml:9 redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi redirecting (type: action) dellemc.enterprise_sonic.sonic_bgp to dellemc.enterprise_sonic.sonic redirecting (type: action) dellemc.enterprise_sonic.sonic_bgp to dellemc.enterprise_sonic.sonic fatal: [Z9264-11]: FAILED! => { "changed": false, "invocation": { "module_args": { "config": [ { "bestpath": null, "bgp_as": "65115", "log_neighbor_changes": null, "max_med": { "on_startup": { "med_val": null, "timer": 420 } }, "router_id": null, "rt_delay": null, "timers": null, "vrf_name": "default" } ], "state": "merged" } }, "msg": "missing required attribute path" } PLAY RECAP ********************************************************************************************************************************************************************************************************************************* Z9264-11 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 linuxadmin@dvae-r640-01-vm2-services:~/Automation/Ansible/testing$ ` sample playbook `~/Automation/Ansible/testing$ cat bgp-playbook.yaml --- - name: Ansible Enterprise SONiC BGP resource module hosts: Z9264-11 gather_facts: False connection: httpapi collections: - dellemc.enterprise_sonic tasks: - name: Configure BGP Global attributes dellemc.enterprise_sonic.sonic_bgp: config: - bgp_as: 65115 max_med: on_startup: timer: 420 ` ### Product Name Dell Enterprise SONiC ### Component or Module Name sonic_bgp ### DellEMC Enterprise SONiC Ansible Collection Version dellemc.enterprise_sonic 2.2.0 ### SONiC Software Version SONiC 4.4.0 ### Configuration vm2-services:~/Automation/Ansible/testing$ ansible-config dump --only-changed STRING_CONVERSION_ACTION(/etc/ansible/ansible.cfg) = ignore ### Steps to Reproduce Configure max_med on_startup timer without max med value ### Expected Behavior able to configure max med on_startup ### Actual Behavior without using max_med value not able to configure using ansible. via sonic-cli user is able configure cli "max-med on-startup 420" ### Logs ` ansible-playbook [core 2.12.0] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/linuxadmin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/linuxadmin/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-playbook python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] jinja version = 3.0.3 libyaml = True Using /etc/ansible/ansible.cfg as config file host_list declined parsing /home/linuxadmin/Automation/Ansible/testing/inventory.ini as it did not pass its verify_file() method script declined parsing /home/linuxadmin/Automation/Ansible/testing/inventory.ini as it did not pass its verify_file() method auto declined parsing /home/linuxadmin/Automation/Ansible/testing/inventory.ini as it did not pass its verify_file() method yaml declined parsing /home/linuxadmin/Automation/Ansible/testing/inventory.ini as it did not pass its verify_file() method Parsed /home/linuxadmin/Automation/Ansible/testing/inventory.ini inventory source with ini plugin redirecting (type: action) dellemc.enterprise_sonic.sonic_bgp to dellemc.enterprise_sonic.sonic Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: bgp-playbook.yaml **************************************************************************************************************************************************************************************************************** 1 plays in bgp-playbook.yaml PLAY [Ansible Enterprise SONiC BGP resource module] **************************************************************************************************************************************************************************************** META: ran handlers redirecting (type: action) dellemc.enterprise_sonic.sonic_bgp to dellemc.enterprise_sonic.sonic TASK [Configure BGP Global attributes] ***************************************************************************************************************************************************************************************************** task path: /home/linuxadmin/Automation/Ansible/testing/bgp-playbook.yaml:9 redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi redirecting (type: action) dellemc.enterprise_sonic.sonic_bgp to dellemc.enterprise_sonic.sonic redirecting (type: action) dellemc.enterprise_sonic.sonic_bgp to dellemc.enterprise_sonic.sonic fatal: [Z9264-11]: FAILED! => { "changed": false, "invocation": { "module_args": { "config": [ { "bestpath": null, "bgp_as": "65115", "log_neighbor_changes": null, "max_med": { "on_startup": { "med_val": null, "timer": 420 } }, "router_id": null, "rt_delay": null, "timers": null, "vrf_name": "default" } ], "state": "merged" } }, "msg": "missing required attribute path" } PLAY RECAP ********************************************************************************************************************************************************************************************************************************* Z9264-11 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 ` ### Screenshots _No response_ ### Additional Information _No response_
kerry-meyer commented 3 months ago

This bug has been fixed by the merging of Fix GitHub issue#416 #418 .