Open samuellay opened 1 year ago
Here is my test case:
---
- name: Collect Interface Info from Brocade Switch
vars:
user_name: ansibleuser
ansible_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
36623134393235616264663036366137396263616533653935356138393261653533373363633235
6635323930633564323334663335393335386332623266350a343038353462366537623538393334
62363266346238663131393463616265653730363037393631353166336331383230316630303062
3439313934636662660a303737656465633761393964616236653430633131616661386539666462
6331
hosts: all
gather_facts: False
connection: local
collections:
-brocade.fos
tasks:
- name: set up credentials for login
ansible.builtin.set_fact:
credential:
fos_ip_addr: "{{ inventory_hostname }}"
fos_user_name: "{{ user_name }}"
fos_password: "{{ ansible_password }}"
https: self
no_log: true
- name: Gather the switch information for Brocade SAN Switch
brocade.fos.brocade_facts:
credential: "{{credential}}"
vfid: -1
gather_subset:
- brocade_interface_fibrechannel
register: switch_facts
no_log : true
- name: Show me the neighbors
debug:
msg: "{{ item.neighbor }}"
with_items: "{{ switch_facts['ansible_facts']['brocade_interface_fibrechannel'] }}"
This issue is addressed in FOS switch release 9.2.1 as shown below: [NO ENTRIES] "neighbor": {},
[ONE ENTRY] "neighbor": { "wwn": [ "20:10:c4:f5:7c:02:8b:08" ] },
[TWO ENTRIES] "neighbor": { "wwn": [ "20:14:c4:f5:7c:d3:be:ae", "10:00:00:10:9b:57:00:72" ] }, Please let us know, what is the switch release at your end.
If there are no further issues, please suggest if we can close this issue.
If there are no further issues, please suggest if we can close this issue.
The _brocade.fos.brocade_interfacefibrechannel module returns flogis in 3 different forms. This requires a lot of extra coding to audit the switches since there are 3 special cases to deal with.
When there are multiple flogis, you get a result that is straight-forward to access in the general case:
If a port has no flogis, you get something like this:
When it has one flogi you'll get:
It would be a lot easier to extract the data if the data structure was consistent:
Please consider adjusting the data structures for the no-flogi and single-flogi cases to match the multi-flogi (NPIV) case.