I'm fairly confident my module can do it, I just have never done that with 
the vsphere API. If you have already written a script to do this in 
pysphere it should be pretty simple to port that. I am assuming that you 
want to do a ReconfigVM_Task and it would look something like this below. 
One thing my module is definitely missing is a good facts gathering system. 
So you would need to gather the device key information in your inventory 
script. 

      local_action:
        module: vsphere
        host: "{{ vcenter_host }}"
        login: "{{ vcenter_login }}"
        password: "{{ vcenter_password }}"
        timeout: 60
        guest:
          name: "{{ deleteme }}"
          state: running
          action: task
        spec:
          type: ReconfigVM_Task
          value:
            spec:
              VirtualMachineConfigSpec:
                deviceChange:
                  - VirtualDeviceConfigSpec:
                  operation: remove
                  device:
                    VirtualCdrom:
                      key: <actual key of your cdrom>








On Thursday, August 21, 2014 4:36:54 AM UTC-7, Dave Hatton wrote:
>
> One thing that is missing from the current vsphere module is the ability 
> reconfigure the cdrom device. My current build process uses a boot.iso to 
> start the build (dont ask why) and so at the end of the create I want to 
> remove the cdrom.
>
> I'm currently using an external script that calls pysphere to do this, it 
> would be nice to have this built in to the ansible module - I'm struggling 
> to work out how to do this. Tony would your module handle this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6d4a6c47-19ac-42cd-a51e-459b372e30f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to