aruba / aoscx-ansible-collection

Ansible collections for AOS-CX switches 
47 stars 23 forks source link

Issue with aoscx_facts module (requirement of specifying ansible_aoscx_rest_version value) #88

Open muralihcl opened 9 months ago

muralihcl commented 9 months ago

Hi Team,

When we attempt to use aoscx_facts module to fetch the information from Aruba CX switch, certain families expect us to specify the value for ansible_aoscx_rest_version variable. Under the https://switch_ip/rest URI, the latest version available does not match what we need to specify. In order to make our ansible playbooks more futuristic, we were trying to figure out a logic which can help us to detect needed rest version for individual switches. Can someone point me in the right direction?

With regards,

Muralidhara Kakkunje

alagoutte commented 9 months ago

What stuff need to specify the rest_version ?

muralihcl commented 9 months ago

Hi @alagoutte ,

There is an issue with platforms 6200, 6300, 6400, 8100, 8360 and 9300 when physical_interfaces are gathered; those platforms need REST v10.09 in order to get proper information. If default version for REST is used, a warning message is displayed indicating that the platform is not supported. In the case of 8360, the information is shown from Halon version 10.09, previous versions are not supported.

Parameter ansible_aoscx_rest_version in inventory file or variable in the playbook. Example: ansible_aoscx_rest_version: 10.09

With the default version of 10.04, it gives an error saying retrieval of physical interfaces details is no longer supported and need to specify the version to 10.09 for it to work properly.

With regards,

Muralidhara Kakkunje

tchiapuziowong commented 9 months ago

@muralihcl we're investigating a method to allow for dynamic interpretation of latest supported API in the pyaoscx SDK, in the meantime are you able to define v10.09 as the version and your playbooks function successfully?

muralihcl commented 9 months ago

Hi @tchiapuziowong ,

Yes, if I specify the version, then it works. My concern is with the inventory which has different models of switches some supporting 10.04 and some supporting 10.09. This makes it hard to know which version works on a specific switch beforehand.

If there are any hint on retrieving the version that works on a switch using REST API, I can try giving it a shape within the playbook itself. As I stated above, if the /rest endpoints helps us to identify the version the switch supports, it could have been easy. But, that is not the case. We only can think of trial and error method looking for warnings key within the response. I have applied this workaround, but I am not quite happy about that.

With regards,

Muralidhara Kakkunje

alagoutte commented 9 months ago

Hi @tchiapuziowong ,

Yes, if I specify the version, then it works. My concern is with the inventory which has different models of switches some supporting 10.04 and some supporting 10.09. This makes it hard to know which version works on a specific switch beforehand.

If there are any hint on retrieving the version that works on a switch using REST API, I can try giving it a shape within the playbook itself. As I stated above, if the /rest endpoints helps us to identify the version the switch supports, it could have been easy. But, that is not the case. We only can think of trial and error method looking for warnings key within the response. I have applied this workaround, but I am not quite happy about that.

With regards,

Muralidhara Kakkunje

What firmware do you using ? because if you are using 10.10, all switch will be support 10.09

muralihcl commented 8 months ago

Hi @alagoutte ,

Within our lab among 6 devices, I got below versions.

"GL.10.11.1010" "GL.10.11.1005" "XL.10.12.1000" "LL.10.11.1005"

But, this code we are preparing right now is expected to work in a customer environment. There, we are not sure on the versions they will be having in their environment..

With regards,

Muralidhara Kakkunje

alagoutte commented 8 months ago

Hi @alagoutte ,

Within our lab among 6 devices, I got below versions.

"GL.10.11.1010" "GL.10.11.1005" "XL.10.12.1000" "LL.10.11.1005"

But, this code we are preparing right now is expected to work in a customer environment. There, we are not sure on the versions they will be having in their environment..

With regards,

Muralidhara Kakkunje

Yes, like @tchiapuziowong say, need to wait an update with support of last API release automatically