vmware issue

I am having an issue deploying servers from templates using ansible with the vmware_guest module. Below is the playbook. I get the following error regardless of what I configure for datastores, esxi host etc. I am currently running the latest version

},

“msg”: “Network interface ‘Network adapter 1’ uses network ‘DVSwitch: c5 de 2d 50 8f fe 22 dd-fd dc 6a 6b 5f 9c 97 73’, which is not accessible.”

}

I can deploy a server from template via the vcenter console so this appears to be an ansible issue? Any ideas?

Thanks

  • hosts: localhost

gather_facts: no

vars_files:

  • group_vars/vars

  • group_vars/vars_sec

tasks:

  • name: Clone the template

vmware_guest:

hostname: “{{ vcenter_server }}”

username: “{{ vcenter_user }}”

password: “{{ vcenter_pass }}”

validate_certs: False

name: “{{ name }}”

template: “{{ template }}”

datacenter: “{{ datacenter_name }}”

folder: “{{ folder }}”

esxi_hostname: “{{ esxi_hostname }}”

state: poweredon

wait_for_ip_address: yes

delegate_to: localhost

The template has a defined network interface? If that’s the case, try to remote the network interface to the template.

vmware_guest module is able to add network interfaces if required. Just provide the rigth VLAN according to naming convention used in vmware cluster.