File tree 3 files changed +48
-0
lines changed
3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ Example Ansible playbook to manage VMware using HTTP APIs:
22
22
- [ Get a list of all Datastores available] ( ../master/get_all_datastores.yml )
23
23
- [ Get a list of all Network available] ( ../master/get_all_networks.yml )
24
24
- [ Get a list of all Virtual machine available] ( ../master/get_all_vms.yml )
25
+ - [ Get a list of all categories available] ( ../master/get_all_categories.yml )
26
+ - [ Get a list of all tags available] ( ../master/get_all_tags.yml )
25
27
- [ Get information about the given Cluster] ( ../master/get_cluster_info.yml )
26
28
27
29
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Gather all Categories for vCenter
3
+ gather_facts : no
4
+ vars_files :
5
+ - vcenter_vars.yml
6
+ hosts : localhost
7
+ tasks :
8
+ - name : Login task
9
+ include_tasks : login.yml
10
+
11
+ - name : Get Categories from vCenter
12
+ uri :
13
+ url : https://{{ vcenter_server }}/rest/com/vmware/cis/tagging/category
14
+ force_basic_auth : yes
15
+ validate_certs : " {{ validate_certs }}"
16
+ headers :
17
+ Cookie : " {{ login.set_cookie }}"
18
+ register : vCategories
19
+
20
+ - name : Print names of Categories in the given vCenter
21
+ debug :
22
+ msg : " {{ item }}"
23
+ with_items : " {{ vCategories.json.value }}"
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Gather all Tags for vCenter
3
+ gather_facts : no
4
+ vars_files :
5
+ - vcenter_vars.yml
6
+ hosts : localhost
7
+ tasks :
8
+ - name : Login task
9
+ include_tasks : login.yml
10
+
11
+ - name : Get Tags from vCenter
12
+ uri :
13
+ url : https://{{ vcenter_server }}/rest/com/vmware/cis/tagging/tag
14
+ force_basic_auth : yes
15
+ validate_certs : " {{ validate_certs }}"
16
+ headers :
17
+ Cookie : " {{ login.set_cookie }}"
18
+ register : vTags
19
+
20
+ - name : Print names of Tags in the given vCenter
21
+ debug :
22
+ msg : " {{ item }}"
23
+ with_items : " {{ vTags.json.value }}"
You can’t perform that action at this time.
0 commit comments