ansible-collections / community.vmware

Ansible Collection for VMware
GNU General Public License v3.0
348 stars 339 forks source link

vmware_guest networks does not replace existing network settings #2176

Open juresaht2 opened 1 month ago

juresaht2 commented 1 month ago
SUMMARY

vmware_guest's networks parameter used to replace the existing network settings. It does not do that anymore, instead the provided networks are added on top and the old settings can still be viewed using nmtui.

ISSUE TYPE
COMPONENT NAME

vmware_guest

ANSIBLE VERSION
ansible [core 2.16.2]
  config file = /home/user/cpanel.t-2.net/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.5 (main, Oct 25 2023, 14:45:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-21)] (/usr/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
# /usr/local/lib/python3.11/site-packages/ansible_collections
Collection       Version
---------------- -------
community.vmware 4.0.1  
CONFIGURATION
CONFIG_FILE() = /home/user/project/ansible.cfg
DEFAULT_ROLES_PATH(/home/user/project/ansible.cfg) = ['/home/user/project/roles']
DEFAULT_STDOUT_CALLBACK(/home/user/project/ansible.cfg) = yaml
HOST_KEY_CHECKING(/home/user/project/ansible.cfg) = False
OS / ENVIRONMENT

Target OS is Rocky 9.

STEPS TO REPRODUCE

Create VM using vmware_guest with a single network provided in networks:.

EXPECTED RESULTS

VM is created with a single network config visible in nmtui . The network config should match the settings provided in networks:.

ACTUAL RESULTS

VM is created with two network configs visible in nmtui . Both are named the same way and attached to the same device, but one contains the provided settings while the other contains the original settings from the template.

juresaht2 commented 1 month ago

Workaround is to remove the settings in nmtui in the template. This works, however it is inconvenient.