Open karlism opened 1 year ago
Add to module_settings one more argument: port_allocation: elastic
and try run.
@ihumster, thanks, that helped:
$ cat dvs_portgroup.yml
---
- hosts: "localhost"
gather_facts: false
tasks:
- community.vmware.vmware_dvs_portgroup: &module_settings
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: "{{ vcenter_validate_certs }}"
portgroup_name: "666-EXAMPLE"
switch_name: "DEV_DVS"
vlan_id: "666"
port_binding: "static"
# test:
port_allocation: "elastic"
state: present
- community.vmware.vmware_dvs_portgroup:
<<: *module_settings
$ ansible-playbook dvs_portgroup.yml
PLAY [localhost] **********************************************************************
TASK [community.vmware.vmware_dvs_portgroup] ******************************************
ok: [localhost]
TASK [community.vmware.vmware_dvs_portgroup] ******************************************
ok: [localhost]
PLAY RECAP ****************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
According to the documentation it should have been elastic already, is that a bug in documentation? "Will be elastic if not specified and port_binding is set to static."
Most likely yes, there is an inaccuracy in the documentation. I'll look at the code and try to fix it in the documentation.
SUMMARY
Changed status is always true for tasks that manage DVS portgroups.
ISSUE TYPE
COMPONENT NAME
community.vmware.vmware_dvs_portgroup
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
OpenBSD 7.3 amd64
STEPS TO REPRODUCE
EXPECTED RESULTS
First run of DVS portgroup configuration task should have changed status, but the second one should not as nothing has been changed.
ACTUAL RESULTS
Second run of the DVS portgroup configuration task shouldn't have any changes reported: