vmware_guest and MAC problem on template clone

Hi,
I am cloning a template in vmware to create a new VM. The script works but when I create an other VM the new one gets created with the same MAC address for the network card. Is there a way form vmware_guest to force a new mac address or a random one without writing it by hand in the playbook?

Thanks,
daniel

Hi,

I removed the network card in the template and when i deploy a new VM, add the networks parameters (name, type, ip,network,gateway) in the vmware_guest module. In this case, it adds a new interface with unique mac address. You may try this method.

Hope it helps.

Thanks for the suggestion! I will try it.

I have for the moment also another solution I generate a random mac address.

networks:
   - name: '{{ network_name }}'
     type: dhcp
     mac: "{{ '00:50:56' | random_mac }}"