Pure-Storage-Ansible / FlashArray-Collection

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

Fix clearing DS certificate #512

Closed sdodsley closed 7 months ago

sdodsley commented 7 months ago
SUMMARY

Fixes issue with clearing a management ceet with empty string Fixes #514

ISSUE TYPE
COMPONENT NAME

purefa_ds.py

tylergmuir commented 7 months ago

@sdodsley I opened an issue on purefa_ds (#514). I didn't open a PR since you already had one to fix a bug in the same module. I had a couple of thoughts on a fix. First was changing this:

        if state == "absent" and dirserv.uris != []:
            delete_ds_v6(module, arrayv6)

to this:

        if state == "absent":
            if dirserv.uris != []:
                delete_ds_v6(module, arrayv6)
            else:
                module.exit_json(changed=False)

at about line 620 should fix it.

But that would only fix the issue if we can assume that there is no DS configuration if there is no URI set. I didn't check to see if this is a good assumption or not or if you could set the rest of the configuration without the URI, so we should check against all of the attributes.

If you want to leave this for a separate PR, that is also fine with me.

ryuyamag commented 7 months ago

@sdodsley Appreciate the additional update. Clearing the cert is now working.

But, "check_peer" cannot be change to true or false even if there is an existing certificate. It was possible in previous version. purefa_ds_disablepeer.yml.zip

ryuyamag commented 7 months ago

I tried this version but result is same as the 4bab093.

Clearing the cert is now working. But, "check_peer" cannot be change to true or false even if there is an existing certificate.

sdodsley commented 7 months ago

@ryuyamag I think I fixed it .

ryuyamag commented 7 months ago

@sdodsley I confirmed it fixed. Thanks a lot.