mirror of https://github.com/ansible/ansible.git
VMware: Handle multiple tags with different category (#66465)
vmware_tag_info used to return dict of tag information which caused data loss when there are multiple tags with same name and different category ids. This fix will add additional fact "tag_info" which will deprecated existing fact "tag_facts". The "tag_info" is a list which handles multiple tags with same name. Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>pull/66705/head
parent
0da13469d3
commit
fc6476bd72
@ -0,0 +1,3 @@
|
||||
cloud/vcenter
|
||||
unsupported
|
||||
zuul/vmware/vcenter_only
|
||||
@ -0,0 +1,5 @@
|
||||
# Test code for the vmware_tag_info.
|
||||
# Copyright: (c) 2020, Abhijeet Kasurde <akasurde@redhat.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
- include: tag_info.yml
|
||||
@ -0,0 +1,24 @@
|
||||
# Test code for the vmware_tag_info.
|
||||
# Copyright: (c) 2020, Abhijeet Kasurde <akasurde@redhat.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
- when: vcsim is not defined
|
||||
block:
|
||||
- &tag_info
|
||||
name: Get info about tag
|
||||
vmware_tag_info:
|
||||
hostname: '{{ vcenter_hostname }}'
|
||||
username: '{{ vcenter_username }}'
|
||||
password: '{{ vcenter_password }}'
|
||||
validate_certs: False
|
||||
register: tag_info
|
||||
|
||||
- <<: *tag_info
|
||||
name: Get info about tag in check mode
|
||||
check_mode: yes
|
||||
|
||||
- name: Check if facts exists
|
||||
assert:
|
||||
that:
|
||||
- tag_info['tag_facts'] is defined
|
||||
- tag_info['tag_info'] is defined
|
||||
Loading…
Reference in New Issue