Greetings all. Apologies if this is not the correct place to post this but I wasn't able to find anything related to this.
So I have recently began playing with Ansible and I am trying to build some VMs in Vmware Sphere using the Ansible module. However I can't seem to be able to attach the CD rom to the VM with VMware. Below is the error I receive along with the syntax of my playbook. Any assistance would be much appreciated.
My error:
PLAY [all] ********************************************************************
TASK: [vsphere_guest ] ********************************************************
failed: [EXAMPLE-Web01] => {"failed": true}
msg: unsupported parameter for module: vm_cdrom
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/ansible/create_vm.retry
EXAMPLE-Web01 : ok=0 changed=0 unreachable=0 failed=1
----------------------------------------------------------------------------------------------------------
My playbook:
- hosts: all
gather_facts: false
connection: local
user: ansible
sudo: true
vars_prompt:
- name: "vcenter_hostname"
prompt: "Enter vcenter hostname"
private: no
- name: "vcenter_user"
prompt: "Enter vcenter username"
private: no
- name: "vcenter_pass"
prompt: "Enter vcenter password"
private: yes
vars:
datacenter: 'My-Datacenter'
notes: 'Created by Ansible'
tasks:
- vsphere_guest:
vcenter_hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_user }}"
password: "{{ vcenter_pass }}"
guest: "{{ inventory_hostname }}"
state: powered_on
vm_extra_config:
notes: "{{ notes }}"
vm_disk:
disk1:
size_gb: "{{ disk }}"
type: thick
datastore: "{{ datastore }}"
# Attach CD ROM to VM
vm_cdrom:
type: "iso"
iso_path: "datastore1/iso/ansible-ks.iso"
vm_nic:
nic1:
type: vmxnet3
network: "{{ network }}"
network_type: standard
vm_hardware:
memory_mb: "{{ memory }}"
num_cpus: "{{ cpucount }}"
osid: "{{ osid }}"
scsi: paravirtual
esxi:
datacenter: "{{ datacenter }}"
hostname: "{{ esxi_host }}"
------------------------------------------------------------
Hosts defined
EXAMPLE-Web01 disk='8' datastore='datastore1' network='vlan1' memory='512' cpucount='2' osid='rhel6_64Guest'