Pure-Storage-Ansible / FlashArray-Collection

Ansible Collection for Pure Storage FlashArray
GNU General Public License v3.0
18 stars 23 forks source link

Multiple network module fixes/changes #474

Closed sdodsley closed 1 year ago

sdodsley commented 1 year ago
SUMMARY

Add support for interface parameter with options of vif, lacp. New, associated, parameters of subinterfaces for interface type of vif and subordinates of interface type lacp.

Add parameters enabled (default True) and subnet.

Closes #466 Closes #473 Closes #472 Closes #391

ISSUE TYPE
COMPONENT NAME

purefa_network.py

tylergmuir commented 1 year ago

From my testing, this doesn't appear to fix #473. I think the issue is that the address that is being past in is 0.0.0.0/0 but the pure array returns None. Same goes for the gateway.

In quickly looking over the code, I don't see a great way to fix this other than just doing another set of if statements, but I could be overlooking something.

sdodsley commented 1 year ago

I'll take another look at it

sdodsley commented 1 year ago

@tylergmuir I think that gets it now. Please let me know if your testing is successful or not.

tylergmuir commented 1 year ago

@sdodsley That did fix the reporting on the interfaces. But I just tested updating an existing vif and it failed. Collecting more info to provide now and will have that to you shortly.

sdodsley commented 1 year ago

@tylergmuir @ryuyamag I think this now fixes all your concerns.

tylergmuir commented 1 year ago

@sdodsley It looks like the configuration for the vif is applying correctly now, but it is always reporting as changed.

sdodsley commented 1 year ago

@tylergmuir can you give an example task that is reporting idempotency incorrectly

tylergmuir commented 1 year ago

@sdodsley this is the basis of what I am doing

- name: Configure vif for file
  purestorage.flasharray.purefa_network:
    name: filevif
    servicelist:
      - file
    interface: vif
    subinterfaces:
      - eth4
      - eth5
    address: "{{ ip_cidr }}"
    gateway: "{{ gateway }}"
    mtu: 1500
sdodsley commented 1 year ago

@tylergmuir ok - fixed it... Hopefully this is the last iteration. I never want to see this module again :)

tylergmuir commented 1 year ago

@sdodsley It works! I ran a few more tests with different configs and it did what I expected it to do each time.

ryuyamag commented 1 year ago

@sdodsley

very sorry, it seems that two functions do not work.

  1. clear address ipv4&ipv6 failed to detect a valid IP

  2. clear gateway ipv4&ipv6 changed:true appears, but it's not changed.

I have attached the log file network2.zip

sdodsley commented 1 year ago

@ryuyamag I think I got it now. Please try all your tests and let me know how it goes. @tylergmuir please confirm this last fix didn't break anything in your tests.

ryuyamag commented 1 year ago

@sdodsley I had to modify some Playbooks this time, but I can confirm that everything works fine. thank you.

tylergmuir commented 1 year ago

@sdodsley looks good on my side too.