-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue of the vmware_cluster_info module does not decode of a clus… #366
Fix issue of the vmware_cluster_info module does not decode of a clus… #366
Conversation
Hey @sky-joker, Thank you for fix it. I have a question, if it may be impacting other ansible resources that collect those facts from VMware, like Datacenter, Datastore, VM Guest name. regards |
Thank you for reporting this issue. First of all, can you please try this bug fixed module work at your environment, and please let me know the result? |
Hey @sky-joker, I have not tested yet, but I can tell you that it will work because it is very similar to the change that I did to work in my lab.
I will test it on Monday, and let you know if everything worked as expected. regards |
By the way, you can even get around this issue with the following like playbook. - name: Workaround Playbook Example
hosts: localhost
gather_facts: no
vars:
# urlencode will not convert from ‘/‘ to ‘%2f'
# workaround: https://jinja.palletsprojects.com/en/2.11.x/templates/#urlencode
cluster_name: "Cluster{{ '/\\%' | urlencode | replace('/', '%2f') | lower }}"
tasks:
- name: "Gather all cluster info"
vmware_cluster_info:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
datacenter: "{{ datacenter_name }}"
register: gather_all_cluster
- debug:
msg:
- "{{ gather_all_cluster.clusters[cluster_name] }}" There has been an issue with VMware modules not doing URL decoding for some time now, do you want to continue to respond with a workaround? |
Hey @sky-joker, I have tried to test on Ansible 2.9.10, however, the code on the file is a little bit different than the current version on Git. I imported the unquote lib from ansible and changed the result line to unquote the cluster name, and it worked like a charm. |
Thank you @RudneiBertolJr for taking the time out of checking the module work :) |
Can we get the same problem with some other resource type? |
Hi @goneri I think some modules will be the same problem that occurs (mainly the |
Thank you @sky-joker for the patch. |
recheck |
Can you please check why the following error occurs by CI?
https://dashboard.zuul.ansible.com/t/ansible/build/b9c74b5e85b44f2c919e876b6b183244 |
It should be better now. |
recheck |
4 similar comments
recheck |
recheck |
recheck |
recheck |
Depends-On: #374
SUMMARY
This PR is to fix the vmware_cluster_info module does not urldecode of a cluster name.
fixes: #365
ISSUE TYPE
COMPONENT NAME
plugins/modules/vmware_cluster_info
ADDITIONAL INFORMATION
tested on vCenter/ESXi 6.7