forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VMware: add facts about tags in vmware_cluster_facts (ansible#56848)
Fixes: ansible#46458 Signed-off-by: Abhijeet Kasurde <[email protected]>
- Loading branch information
Showing
7 changed files
with
152 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- vmware_cluster_facts now supports tag facts (https://github.com/ansible/ansible/issues/46458). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
test/integration/targets/prepare_vmware_tests/tasks/setup_category.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- name: Create a category for cluster | ||
vmware_category: | ||
hostname: '{{ vcenter_hostname }}' | ||
username: '{{ vcenter_username }}' | ||
password: '{{ vcenter_password }}' | ||
validate_certs: False | ||
category_name: '{{ cluster_category }}' | ||
category_description: '{{ cluster_category }} description' | ||
state: present |
27 changes: 27 additions & 0 deletions
27
test/integration/targets/prepare_vmware_tests/tasks/setup_tag.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
- name: Get Category facts | ||
vmware_category_facts: | ||
hostname: '{{ vcenter_hostname }}' | ||
username: '{{ vcenter_username }}' | ||
password: '{{ vcenter_password }}' | ||
validate_certs: False | ||
register: cat_info | ||
|
||
- name: Get Category id for {{ cluster_category }} | ||
set_fact: | ||
cluster_category_id: "{{ item.category_id }}" | ||
with_items: | ||
- "{{ cat_info.tag_category_facts | json_query(query) }}" | ||
vars: | ||
query: "[?category_name=='{{ cluster_category }}']" | ||
|
||
- name: Create a tag for cluster | ||
vmware_tag: | ||
hostname: '{{ vcenter_hostname }}' | ||
username: '{{ vcenter_username }}' | ||
password: '{{ vcenter_password }}' | ||
validate_certs: False | ||
category_id: '{{ cluster_category_id }}' | ||
tag_name: '{{ cluster_tag }}' | ||
tag_description: '{{ cluster_tag }} Description' | ||
state: present | ||
when: cluster_category_id is defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters