-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified vcenter_vm_customize test to run on real vCebter (#577)
Modified vcenter_vm_customize test to run on real vCenter Reviewed-by: Shelly Miron Reviewed-by: Polina Rabinovich Reviewed-by: Anna Savina
- Loading branch information
1 parent
4a41c63
commit a1a027d
Showing
12 changed files
with
221 additions
and
214 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
tests/integration/targets/action_on_vm/create_vm_from_template.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,17 @@ | ||
--- | ||
- name: Create a generic resource pool | ||
vmware.vmware_rest.vcenter_resourcepool: | ||
name: "{{ resource_pool_name }}" | ||
parent: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/' + vcenter_datacenter + '/' + vcenter_cluster_name + '/' + resource_pool_parent_name) }}" | ||
register: resource_pool_info | ||
|
||
- name: Deploy a new VM based on the template | ||
vmware.vmware_rest.vcenter_vmtemplate_libraryitems: | ||
name: "{{ vm_name }}" | ||
template_library_item: "{{ vcenter_test_vm_template.id }}" | ||
placement: | ||
cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/' + vcenter_datacenter + '/' + vcenter_cluster_name) }}" | ||
folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/' + vcenter_datacenter + '/' + vcenter_vm_folder) }}" | ||
resource_pool: "{{ resource_pool_info.id }}" | ||
state: deploy | ||
register: vm_from_template |
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,20 @@ | ||
--- | ||
- name: Power off VM | ||
vmware.vmware_rest.vcenter_vm_guest_power: | ||
vm: "{{ vm_id }}" | ||
state: shutdown | ||
|
||
- name: Wait until VM is off | ||
vmware.vmware_rest.vcenter_vm_info: | ||
vm: "{{ vm_id }}" | ||
register: vm_info | ||
until: | ||
- vm_info is not failed | ||
- vm_info.value.power_state == "POWERED_OFF" | ||
retries: 60 | ||
delay: 5 | ||
|
||
- name: Delete VM | ||
vmware.vmware_rest.vcenter_vm: | ||
vm: "{{ vm_id }}" | ||
state: absent |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
10 changes: 0 additions & 10 deletions
10
tests/integration/targets/vcenter_vm_customize/playbook.yml
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
tests/integration/targets/vcenter_vm_customize/refresh_RETURN_block.sh
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
185 changes: 0 additions & 185 deletions
185
tests/integration/targets/vcenter_vm_customize/tasks/main.yml
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
tests/integration/targets/vmware_rest_vcenter_vm_customize/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
test_resource_pool_name: "{{ tiny_prefix }}-vm-customize-resource-pool" | ||
test_vm_name: "{{ tiny_prefix }}-vm" | ||
new_vm_setting: | ||
vm_ip: 10.46.29.150 | ||
dns_host_name: test | ||
dns_servers: 1.1.1.1 |
9 changes: 9 additions & 0 deletions
9
tests/integration/targets/vmware_rest_vcenter_vm_customize/playbook.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 @@ | ||
- hosts: localhost | ||
gather_facts: no | ||
|
||
tasks: | ||
- name: Import vcenter vm cusromize test | ||
ansible.builtin.import_role: | ||
name: vmware_rest_vcenter_vm_customize | ||
tags: | ||
- eco-vcenter-ci |
Oops, something went wrong.