mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-24 13:04:00 -07:00
VMware: check if folder already exists before creation (#41588)
* check if folder already exists before creation * added integration test
This commit is contained in:
parent
249a6aae22
commit
1e4831e744
2 changed files with 22 additions and 4 deletions
|
|
@ -81,6 +81,23 @@
|
|||
- host
|
||||
- datastore
|
||||
- network
|
||||
|
||||
- name: Recreate all types of sub folder
|
||||
vcenter_folder:
|
||||
hostname: "{{ vcsim }}"
|
||||
username: "{{ vcsim_instance.json.username }}"
|
||||
password: "{{ vcsim_instance.json.password }}"
|
||||
validate_certs: no
|
||||
datacenter: "{{ dc1 }}"
|
||||
folder_name: "sub_{{ item }}_folder"
|
||||
parent_folder: 'vm_folder'
|
||||
state: present
|
||||
register: recreate_folders
|
||||
with_items:
|
||||
- vm
|
||||
- host
|
||||
- datastore
|
||||
- network
|
||||
|
||||
- debug: msg="{{ all_folder_results }}"
|
||||
|
||||
|
|
@ -88,6 +105,7 @@
|
|||
assert:
|
||||
that:
|
||||
- all_folder_results.changed
|
||||
- not recreate_folders.changed
|
||||
|
||||
#- name: Delete all types of folder
|
||||
# vcenter_folder:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue