Closed PatBoEPFL closed 5 months ago
Thank you for bringing these issues to our attention.
For the BGP failure shown (and, I'm guessing, for the bgp_af failure as well), the problem is the result of omission of a required argument 'bgp_as' from the playbook. The bgp_as is the 'key' specifying which BGP instance is to be operated on for the playbook and it must be specified for successful execution of any playbook related to these resource modules.
For the 'port_groups' failure, please let us know which platform type was the target for the failing playbook. If you can provide the first ten lines of "show version" output for the target device, this will provide the platform information I am requesting.
For example: (needed line shown by "<<<" below)
admin@sonic:~$ show version
SONiC Software Version: SONiC-OS-rel_dell_sonic_4.x_share.1833-c9f874533
Product: Generic
Distribution: Debian 11.9
Kernel: 5.10.0-21-amd64
Config DB Version: version_4_3_1
Build commit: c9f874533
Build date: Thu Jun 6 09:17:49 UTC 2024
Built by: dngnetbuild.svc@jenkinsworker-eqx-03
Platform: x86_64-dellemc_s5296f_c3538-r0 <<<
Some platforms do not support port groups. If that was the cause for this failure (to be determined from your "show version" output), we will modify our resource module collection to provide a more specific description of the reason for rejecting a request to gather or modify port group configuration on a device that doesn't support this feature.
Hello Kerry,
Many thanks for your answer!
Sorry, but it remains unclear for me where/how should I enter the bgp_as
parameter, when reading https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_facts_module.html
The platform can be:
Best regards, Patrice
Hi Patrice,
The bgp_as value, when specified in a playbook, is an autonomous system number, either in "dotted" format in the range 0.1 to 65535.65535, or an integer value in the range 1 - 4294967295. It isn't needed for facts gathering, but the failing playbook, despite the comments printed in the output displayed above does not appear to be doing just facts gathering.
The playbook output shown in your description shows a playbook executing a 'merged' state task (a requested configuration change) on the BGP resource module. (This does require the bgp_as. To simply gather all facts for all BGP instances, you don't need to specify any AS. (All of them will be shown in the output.)
But the output shown above in this "Issue" doesn't look right for if it was just for facts gathering.
If you will provide the text of the playbook you executed to obtain the failure above, I can analyze it and explain more details on what is going wrong with execution of that playbook.
Here is an example playbook to gather BGP facts (verified on our server using the 2.4.0 version of our resource module collection):
---
- name: Ansible resource module example
hosts: datacenter
gather_facts: True
connection: httpapi
collections:
- dellemc.enterprise_sonic
tasks:
- name: sonic_bgp_af facts gather
sonic_facts:
gather_subset: min
gather_network_resources:
- bgp
register: result
- name: "debug facts"
debug:
msg: "{{result.ansible_facts.ansible_network_resources}}"
Regarding the port group failure described above: Thank you for specifying the platforms on which you tried this.
Port groups are not supported on these platforms.
The platforms on which they are supported are: s5248 and s5296.
We will add better checking for this incompatibility, along with a more clear statement of the detected incompatibility in an upcoming release of our resource module collection.
I will close this bug unless there are remaining items that require further investigation or resolution.
Here is a summary of the points raised in this issue:
- name: Gather all facts
register: sonic_facts_data
connection: httpapi
dellemc.enterprise_sonic.sonic_facts:
gather_network_resources:
- tacacs_server
- qos_scheduler
- prefix_lists
*
*
*
"router_id": null,
"rt_delay": null,
"timers": {
"holdtime": null, <<< All attributes are empty. There is no configuration here.
"keepalive_interval": null
},
"vrf_name": "default"
}
],
"state": "merged" <<< This option for a configuration playbook is never included for facts gathering.
}
},
"msg": "missing required arguments: bgp_as found in config" <<< Never required for facts gathering.
}
Hello Kerry, Thanks for your answer and explanation! It wasn't clear for me that I was in merged state. Best regards, Patrice
Hi Patrice,
With the merging of the PR cited above (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/396), it will now be possible to gather facts specifying 'gather_network_resources: all' on a platform without port group support. For that case, a warning message will be printed explaining why there is no output for port group configuration, but execution will continue with gathering the 'facts' for other resource modules.
Bug Description
Hello,
I've tried the different resources that can be gathered with sonic_facts module:
With the above task trying 'bgp', I've got the following output:
When a resource is marked as
# must be tested - "<resource name>"
, it means there is no relevant configuration on the tested switch.Product Name
DellEMC-S5232f-C32
Component or Module Name
httpapi, sonic_facts
DellEMC Enterprise SONiC Ansible Collection Version
dellemc.enterprise_sonic-2.4.0
SONiC Software Version
4.1.2-Enterprise_Standard
Configuration
Steps to Reproduce
For resources
bgp
andbgp_af
see description.For
port_group
, do the same but with onlyport_group
as resource:Expected Behavior
We expect to have the facts gathered without error.
Actual Behavior
Impossible to run without error
Logs
see output above
Screenshots
No response
Additional Information
No response