vm_cdrom in vsphere_guest not working

Hi list,

got a small problem in the vsphere_guest module.

ansible --version: 1.9.2

I can’t get the vm_cdrom option to work.

I tried this version, like vm_disk:

vm_extra_config:
notes: “{{ notes }}”
vcpu.hotadd: yes
mem.hotadd: yes
folder: TEST
vm_cdrom:
type: iso
iso_path: “path/to/cd-image.iso”
vm_disk:
disk1:
size_gb: “{{ disk }}”

Which did not work…

And that version, under vm_hardware, according to documentation:

vm_hardware:
memory_mb: “{{ memory }}”
num_cpus: “{{ cpucount }}”
vm_cdrom:
type: iso
iso_path: “VSTOR1-NFS/ISO/cd-image.iso”

osid: “{{ osid }}”

Both with and without " in iso.

Always the same error:

Note: The error may actually appear before this position: line 18, column 1

My comments are here

vm_cdrom:

Note: The error may actually appear before this position: line 32, column 1

My comments are here

vm_cdrom:

Can anybody point me to the right direction, what might be wrong?

Thx a lot in advance!

Best,

Timo

My guess would be its something to do with indentation in your playbook.

I suggest you try editing your playbook in a yaml-aware editor. On windows you can use Notepad++ - or use yamlint.com

Hope this helps,

Jon

Hi Jon,

i tried different indentations. Also used Notepad++, just to be sure.
Just did not work.

It seems to me, it doesn’t even recognize that option. No matter where i put it…

Any other suggestions?

Thx!

Hi Jon,

you were right. Too much copy and paste…
I used your linkgiven software…

It was a [Tab], before vm_cdrom…

So Problem solved, and the option should be set on the vm_hardware section in the end…

Thx again for you quick help!

Best,

Timo

Glad you are up and running.

Should have said there’s an option in Notepad++ somewhere to set it so that it inserts spaces when you hit tab. All your yaml (and python) will be easier for it.

Jon