-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding fix for updating empty CD ROM with clone image attribute (#505)
* Adding fix for updating empty CD ROM with clone image attribute * Adding example and test for updating VM with cloning image into CD ROM * refactoring examples * Creating seperate example file for updating empty CD ROM Moving update empty CD ROM test to CRUD operation for IDE disks section * minor lint fix * resolving comments * Adding disk count assertion to assert that number of disks does not change when updating empty CD ROM
- Loading branch information
1 parent
3b13ae2
commit 854442f
Showing
4 changed files
with
199 additions
and
110 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
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,41 @@ | ||
########################### UPDATE_VM_CDROM ################################ | ||
--- | ||
- name: Create a VM with empty CD ROM and Update that disk with image | ||
hosts: localhost | ||
gather_facts: false | ||
module_defaults: | ||
group/nutanix.ncp.ntnx: | ||
nutanix_host: <pc_ip> | ||
nutanix_username: <user> | ||
nutanix_password: <pass> | ||
validate_certs: false | ||
tasks: | ||
- name: Setting Variables | ||
ansible.builtin.set_fact: | ||
vm_uuid: "" | ||
disk_uuid: "" | ||
|
||
- name: Create VM with empty CD ROM | ||
nutanix.ncp.ntnx_vms: | ||
name: "VM with empty CD ROM" | ||
cluster: | ||
name: "{{ cluster.name }}" | ||
categories: | ||
Environment: | ||
- Production | ||
disks: | ||
- type: "CDROM" | ||
bus: "IDE" | ||
empty_cdrom: true | ||
register: result | ||
|
||
- name: Update VM by cloning image into CD ROM | ||
nutanix.ncp.ntnx_vms: | ||
vm_uuid: "{{ result.vm_uuid }}" | ||
name: "VM with CD ROM updated" | ||
disks: | ||
- type: "CDROM" | ||
uuid: "{{ result.response.spec.resources.disk_list[0].uuid }}" | ||
clone_image: | ||
name: "{{ iso_image_name }}" | ||
register: result |
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
Oops, something went wrong.