# Ansible module “vmware\_portgroup” incorrectly returns “changed”, even when arguments unchanged.

**URL:** <https://forum.ansible.com/t/ansible-module-vmware-portgroup-incorrectly-returns-changed-even-when-arguments-unchanged/28450>\
**Category:** Ansible Project\
**Created:** [August 28, 2018, 6:21pm UTC](https://forum.ansible.com/t/ansible-module-vmware-portgroup-incorrectly-returns-changed-even-when-arguments-unchanged/28450 "2018-08-28T18:21:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbaril](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@dbaril](https://forum.ansible.com/u/dbaril)\
**Post date:** [August 28, 2018, 6:21pm UTC](https://forum.ansible.com/t/ansible-module-vmware-portgroup-incorrectly-returns-changed-even-when-arguments-unchanged/28450/1 "2018-08-28T18:21:58Z")

</div>

The Ansible module “vmware\_portgroup” will incorrectly return a “changed” condition, even when the arguments are unchanged.

The vmware\_portgroup module does run correctly and changes the ESXi portgroup settings as needed, but it always reports a “changed” state.

For example:

- name: Create portgroup Internal Network on vSwitch0

vmware\_portgroup:

hostname: ‘{{ inventory\_hostname }}’

username: ‘{{ vcenter\_username }}’

password: ‘{{ vcenter\_password }}’

esxi\_hostname: ‘{{ inventory\_hostname }}’

validate\_certs: no

portgroup\_name: ‘Internal Network’

switch\_name: ‘vSwitch0’

state: present

delegate\_to: localhost

If you run the task a second time, Ansible will report a “changed” state.

Ansible version: 2.7.5 (from CentOS 7.x epel repository)

yum package ansible.noarch 2.6.3-1.el7

Linux: CentOS 7.5.1804
