vm_cdrom in vsphere_guest not working

158 views
Skip to first unread message

Timo

unread,
Jul 31, 2015, 8:58:40 AM7/31/15
to Ansible Project
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

J Hawkesworth

unread,
Jul 31, 2015, 9:17:53 AM7/31/15
to Ansible Project, bueroa...@web.de
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

Timo

unread,
Jul 31, 2015, 9:35:29 AM7/31/15
to Ansible Project, bueroa...@web.de, j.r.haw...@googlemail.com
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!

Timo

unread,
Jul 31, 2015, 9:42:06 AM7/31/15
to Ansible Project, bueroa...@web.de, j.r.haw...@googlemail.com
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

J Hawkesworth

unread,
Jul 31, 2015, 1:30:59 PM7/31/15
to Ansible Project, bueroa...@web.de, j.r.haw...@googlemail.com
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
Reply all
Reply to author
Forward
0 new messages