zscaler / zpacloud-playbooks

Sample playbooks for the Zscaler Private Access Ansible modules
MIT License
0 stars 1 forks source link

zpa_provisioning_key_facts.yml only retrieves first page of keys #2

Closed CKroes97 closed 1 hour ago

CKroes97 commented 6 days ago

Describe the bug

The zpa_provisioning_key_facts.yml playbook only retrieves keys from the first page of keys in the portal. Therefore you receive an error if you try to retrieve keys from the second page: "Failed to retrieve app connector name", this is especially problematic when using the "name:" argument

Expected behavior

The playbook should work without errors if you try to retrieve a key that is not on the first page.

Current behavior

Retrieving keys from the second page throws an error.

Possible solution

Iterating over all pages to find a match for the requested name.

Steps to reproduce

Context

I want to retrieve a key from the second page of keys in a script to automate provisioning of new app connectors.

Your Environment

willguibr commented 6 days ago

@CKroes97 How many provisioning keys and app connectors do you have?

CKroes97 commented 4 days ago

We are closing in on a hundred keys and 300 app connectors, both figures still stand to grow.

willguibr commented 3 days ago

Thanks @CKroes97 We found the problem and it has to do with how pagination is currently setup in the Python SDK and the Ansible Collection. Give us a couple of days and we'll be releasing a new version of the collection and you will be able to test it out. Thanks for your patience. Zscaler DevRel.

CKroes97 commented 1 hour ago

For now this works for us! In the future it might be useful to also support retrieving multiple pages but that is not urgent for us at this moment.