-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3dd688a
commit 9fec3ee
Showing
5 changed files
with
77 additions
and
51 deletions.
There are no files selected for viewing
17 changes: 12 additions & 5 deletions
17
tests/integration/targets/vmware_folder_template_from_vm/defaults/main.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
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
3 changes: 0 additions & 3 deletions
3
tests/integration/targets/vmware_folder_template_from_vm/runme.sh
This file was deleted.
Oops, something went wrong.
78 changes: 46 additions & 32 deletions
78
tests/integration/targets/vmware_folder_template_from_vm/tasks/main.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 |
---|---|---|
@@ -1,87 +1,101 @@ | ||
--- | ||
- block: | ||
- name: Test On Simulator | ||
when: run_on_simulator | ||
block: | ||
- name: "Test setup: Create Folder" | ||
community.vmware.vcenter_folder: | ||
validate_certs: false | ||
hostname: "{{ vcenter_hostname }}" | ||
username: "{{ vcenter_username }}" | ||
password: "{{ vcenter_password }}" | ||
port: "{{ vcenter_port }}" | ||
datacenter: "{{ vm_datacenter }}" | ||
datacenter: "{{ vcenter_datacenter_name }}" | ||
folder_name: "{{ template_folder }}" | ||
folder_type: vm | ||
state: present | ||
when: run_on_simulator | ||
|
||
- name: "Test setup: Create VM guest {{ vm }}" | ||
- name: "Test setup: Power Off VM guest {{ vm_name }}" | ||
community.vmware.vmware_guest: | ||
validate_certs: false | ||
hostname: "{{ vcenter_hostname }}" | ||
username: "{{ vcenter_username }}" | ||
password: "{{ vcenter_password }}" | ||
cluster: "{{ vm_cluster }}" | ||
cluster: "{{ vcenter_cluster_name }}" | ||
datacenter: "{{ vcenter_datacenter_name }}" | ||
port: "{{ vcenter_port }}" | ||
datacenter: "{{ vm_datacenter }}" | ||
folder: "{{ template_folder }}" | ||
state: present | ||
name: "{{ vm }}" | ||
disk: "{{ vm_disk }}" | ||
guest_id: "{{ vm_guest_id }}" | ||
hardware: "{{ vm_hardware }}" | ||
when: not run_on_simulator | ||
state: poweredoff | ||
name: "{{ vm_name }}" | ||
|
||
- name: "Test setup: Power Off VM guest {{ vm }}" | ||
- name: Create template from vm in vcenter folder | ||
vmware.vmware.folder_template_from_vm: | ||
validate_certs: false | ||
hostname: "{{ vcenter_hostname }}" | ||
username: "{{ vcenter_username }}" | ||
password: "{{ vcenter_password }}" | ||
datacenter: "{{ vcenter_datacenter_name }}" | ||
port: "{{ vcenter_port }}" | ||
template_folder: "{{ template_folder }}" | ||
vm_name: "{{ vm_name }}" | ||
template_name: "{{ template_name }}" | ||
register: __res | ||
|
||
- name: Run On VCenter | ||
when: not run_on_simulator | ||
block: | ||
- name: "Test setup: Create VM guest {{ vm }}" | ||
community.vmware.vmware_guest: | ||
validate_certs: false | ||
hostname: "{{ vcenter_hostname }}" | ||
username: "{{ vcenter_username }}" | ||
password: "{{ vcenter_password }}" | ||
cluster: "{{ vm_cluster }}" | ||
datacenter: "{{ vm_datacenter }}" | ||
cluster: "{{ vcenter_cluster_name }}" | ||
port: "{{ vcenter_port }}" | ||
state: poweredoff | ||
name: "{{ vm }}" | ||
when: run_on_simulator | ||
datacenter: "{{ vcenter_datacenter_name }}" | ||
folder: "{{ template_folder }}" | ||
state: present | ||
name: "{{ vm_name }}" | ||
disk: "{{ vm_disk }}" | ||
guest_id: "{{ vm_guest_id }}" | ||
hardware: "{{ vm_hardware }}" | ||
|
||
- name: Create template from vm in vcenter folder | ||
vmware.vmware.folder_template_from_vm: | ||
validate_certs: false | ||
hostname: "{{ vcenter_hostname }}" | ||
username: "{{ vcenter_username }}" | ||
password: "{{ vcenter_password }}" | ||
datacenter: "{{ vm_datacenter }}" | ||
datacenter: "{{ vcenter_datacenter_name }}" | ||
port: "{{ vcenter_port }}" | ||
template_folder: "{{ template_folder }}" | ||
vm_name: "{{ vm }}" | ||
template_name: "test_template" | ||
vm_name: "{{ vm_name }}" | ||
template_name: "{{ template_name }}" | ||
register: __res | ||
|
||
always: | ||
- name: "Test teardown: Destroy VM guest {{ vm }}" | ||
- name: "Test teardown: Destroy VM guest {{ vm_name }}" | ||
community.vmware.vmware_guest: | ||
validate_certs: false | ||
hostname: "{{ vcenter_hostname }}" | ||
username: "{{ vcenter_username }}" | ||
password: "{{ vcenter_password }}" | ||
cluster: "{{ vm_cluster }}" | ||
cluster: "{{ vcenter_cluster_name }}" | ||
port: "{{ vcenter_port }}" | ||
datacenter: "{{ vm_datacenter }}" | ||
datacenter: "{{ vcenter_datacenter_name }}" | ||
folder: "{{ vm_folder }}" | ||
state: absent | ||
force: true | ||
name: "{{ vm }}" | ||
when: not run_on_simulator | ||
- name: "Test teardown: Destroy VM template {{ vm }}" | ||
name: "{{ vm_name }}" | ||
|
||
- name: "Test teardown: Destroy VM template {{ template_name }}" | ||
community.vmware.vmware_guest: | ||
validate_certs: false | ||
hostname: "{{ vcenter_hostname }}" | ||
username: "{{ vcenter_username }}" | ||
password: "{{ vcenter_password }}" | ||
cluster: "{{ vm_cluster }}" | ||
cluster: "{{ vcenter_cluster_name }}" | ||
port: "{{ vcenter_port }}" | ||
datacenter: "{{ vm_datacenter }}" | ||
datacenter: "{{ vcenter_datacenter_name }}" | ||
folder: "{{ vm_folder }}" | ||
state: absent | ||
force: true | ||
name: "{{ vm }}_template" | ||
when: not run_on_simulator | ||
name: "{{ template_name }}" |
14 changes: 5 additions & 9 deletions
14
tests/integration/targets/vmware_folder_template_from_vm/vars.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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
vcenter_hostname: "127.0.0.1" | ||
vcenter_username: "user" | ||
vcenter_password: "pass" | ||
vcenter_port: 8989 | ||
vm_cluster: DC0_C0 | ||
vm_datacenter: DC0 | ||
vm_folder: test | ||
run_on_simulator: true | ||
vm: DC0_H0_VM0 | ||
--- | ||
run_on_simulator: false | ||
template_folder: e2e-qe | ||
vm_name: folder_template_from_vm_test | ||
vm_name_match: first |