ansible-collections / community.vmware

Ansible Collection for VMware
GNU General Public License v3.0
344 stars 336 forks source link

vmware_guest is not allowing MAC customization using 'random_mac' filter if template is having the network attached #1158

Open Udayendu opened 2 years ago

Udayendu commented 2 years ago
SUMMARY

Newly cloned vms are not having desired MAC via random_mac if the template is attached with a nic. Its taking the MAC from the same prefix as its attached in the template.

ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
$ pip3 show ansible
Name: ansible
Version: 4.5.0
Summary: Radically simple IT automation
Home-page: https://ansible.com/
Author: Ansible, Inc.
Author-email: info@ansible.com
License: GPLv3+
Location: /usr/local/lib/python3.8/dist-packages
Requires: ansible-core
Required-by:

$ pip3 show ansible-core
Name: ansible-core
Version: 2.11.4
Summary: Radically simple IT automation
Home-page: https://ansible.com/
Author: Ansible, Inc.
Author-email: info@ansible.com
License: GPLv3+
Location: /usr/local/lib/python3.8/dist-packages
Requires: packaging, cryptography, PyYAML, jinja2, resolvelib
Required-by: ansible
COLLECTION VERSION
$ ansible-galaxy collection list community.vmware
# /usr/local/lib/python3.8/dist-packages/ansible_collections
Collection       Version
---------------- -------
community.vmware 1.13.0
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
Udayendu commented 2 years ago

Only solution is to make a template without a NIC and then vmware_guest is able to attach the nic with correct MAC prefix as expected.

Udayendu commented 2 years ago

@goneri @Akasurde Can some one take a look into this ? This is an important one as ansible is not able to handle the multiple vms very well with MAC assignment while cloning from a template.