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
VMware: Colon support within VMWare Tags vmware_tag_manager #65765
Comments
Files identified in the description: If these files are inaccurate, please update the |
@limitedreality, just so you are aware we have a dedicated Working Group for vmware. |
As of right now category and tag name are indeed separated by ":", but note that this string is only split once, so currently as a workaround you could specify the category name and then you could use colons in your tag name. For example:
But escaping sounds like a good idea for when there is no category name given. |
@GBrawl Great idea, but unfortunately that fails for me stating InvalidArgument. Basically it's saying the tag_names dict object has no attribute set now. Are you able to test and confirm working on your side? |
Just tested it and it works fine on ansible 2.9.2, can you show me the task you are trying to run? Also you can't have colons in your category name with this approach. |
Here's what I'm using with: Ansible 2.8.0 - name: Add tags to a virtual machine
vmware_tag_manager:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
validate_certs: no
tag_names:
- 'Category:Tag:Name'
object_name: 'TestGuest'
object_type: VirtualMachine
state: add
delegate_to: localhost I know that I'm using the category:name syntax properly as when I apply a tag in that category without a colon it works fine. Interestingly, it seems that it is parsing the tag name properly because if I change the tag name portion to something that doesn't exist (including a colon), it errors saying unable to find that tag. It's only when I supply a valid tag with a colon that it appears to fail. So maybe something specific to the application of the tag?
|
Tried it on 2.8.4 and that also worked for me and your example looks correct, if both the category and the tag name exist it should work. Are you running vSphere 6.5 or higher? |
Yes vSphere 6.5 |
We updated to Ansible 2.8.7 to see if that would help and the results are the same. Anyone have any other thoughts or suggestions? Any further way to debug why we're seeing different results than GBrawl? |
User can now specify tag and category using dict in vmware_tag_manager module. This is useful when tag or category name contains colon. Fixes: ansible#65765 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
resolved_by_pr #66150 |
@limitedreality, Could you please check PR #66150 and let us know if it works for you ? |
User can now specify tag and category using dict in vmware_tag_manager module. This is useful when tag or category name contains colon. Fixes: ansible#65765 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
@limitedreality This issue is waiting for your response. Please respond or the issue will be closed. |
User can now specify tag and category using dict in vmware_tag_manager module. This is useful when tag or category name contains colon. Fixes: #65765 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
SUMMARY
VMWare supports using colons in VMWare tags, however the vmware_tag_manager module does not since colons are used to delineate categories. It would be nice if there was some way to support using colons in tag names.
ISSUE TYPE
COMPONENT NAME
vmware_tag_manager
ADDITIONAL INFORMATION
There should be some way to escape a colon in a tag_name so that we can continue to support categories but intentionally override that functionality when we intend to use a tag with a colon within. Two tag examples below. One with category, one escaping for instance. Feel free to use whatever escape sequence is most supportable.
Including the authors:
@Akasurde
@GBrawl
The text was updated successfully, but these errors were encountered: