diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-05 16:18:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-05 16:18:41 +0000 |
commit | b643c52cf29ce5bbab738b43290af3556efa1ca9 (patch) | |
tree | 21d5c53d7a9b696627a255777cefdf6f78968824 /ansible_collections/community/vmware | |
parent | Releasing progress-linux version 9.5.1+dfsg-1~progress7.99u1. (diff) | |
download | ansible-b643c52cf29ce5bbab738b43290af3556efa1ca9.tar.xz ansible-b643c52cf29ce5bbab738b43290af3556efa1ca9.zip |
Merging upstream version 10.0.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/community/vmware')
19 files changed, 148 insertions, 48 deletions
diff --git a/ansible_collections/community/vmware/.github/workflows/ansible-test.yml b/ansible_collections/community/vmware/.github/workflows/ansible-test.yml index 6a5866e13..79531def6 100644 --- a/ansible_collections/community/vmware/.github/workflows/ansible-test.yml +++ b/ansible_collections/community/vmware/.github/workflows/ansible-test.yml @@ -91,7 +91,8 @@ jobs: testing-type: sanity # OPTIONAL If your sanity tests require code # from other collections, install them like this - # test-deps: >- + test-deps: >- + vmware.vmware # ansible.netcommon # ansible.utils # OPTIONAL If set to true, will test only against changed files, @@ -151,6 +152,7 @@ jobs: test-deps: >- ansible.netcommon ansible.utils + vmware.vmware # OPTIONAL If set to true, will test only against changed files, # which should improve CI performance. See limitations on # https://github.com/ansible-community/ansible-test-gh-action#pull-request-change-detection diff --git a/ansible_collections/community/vmware/CHANGELOG.rst b/ansible_collections/community/vmware/CHANGELOG.rst index 4162c1885..a65557bc0 100644 --- a/ansible_collections/community/vmware/CHANGELOG.rst +++ b/ansible_collections/community/vmware/CHANGELOG.rst @@ -6,6 +6,21 @@ community.vmware Release Notes This changelog describes changes after version 3.9.0. +v4.4.0 +====== + +Minor Changes +------------- + +- vmware_dvs_portgroup - Make `state` default to `present` instead of having it as a required parameter (https://github.com/ansible-collections/community.vmware/pull/2055). + +Bugfixes +-------- + +- Clarify pyVmomi requirement (https://github.com/ansible-collections/community.vmware/pull/2071). +- vmware_cluster_dpm - Handle case where DPM config has not been initialized yet and is None (https://github.com/ansible-collections/community.vmware/pull/2057). +- vmware_dvs_portgroup - Fix erroneously reporting a change when `port_binding` is static and `num_ports` not specified (https://github.com/ansible-collections/community.vmware/pull/2053). + v4.3.0 ====== diff --git a/ansible_collections/community/vmware/FILES.json b/ansible_collections/community/vmware/FILES.json index 68fe7037b..ca7811202 100644 --- a/ansible_collections/community/vmware/FILES.json +++ b/ansible_collections/community/vmware/FILES.json @@ -25,7 +25,7 @@ "name": ".github/workflows/ansible-test.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "75ced302218d85f3484c215700b3626db0288f380c6d549f666f13ddd05585e8", + "chksum_sha256": "03d0884033021aee8129dec83b8f3443844743e9d6a1a3f81f8261b61be37a39", "format": 1 }, { @@ -88,7 +88,7 @@ "name": "changelogs/changelog.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "fa92ffc48b8d5e744ed8748724d0623b9bdc81a4e57798fe99098640234cc5bc", + "chksum_sha256": "3a15dd1e41ea5e7c5183d62584d11ef00cc90c34583f1dcf1a3da094180fdb44", "format": 1 }, { @@ -277,7 +277,7 @@ "name": "plugins/module_utils/vmware.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "902d67e645b235e10d27e179666442625e6ea9df4a4e4589ee6ba1427376b652", + "chksum_sha256": "8379242e20efae1092d67d62665bfc7fd84774d75668439a788e87b374cd8938", "format": 1 }, { @@ -410,7 +410,7 @@ "name": "plugins/modules/vmware_cluster_dpm.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "823d0eba4ad0a749924bc16b0ac8540211a54add654b4ca445c8ad246bddf250", + "chksum_sha256": "017a074c3d73a814baf6c06b7de579942877ab137a4126e4c967c3290bb4f994", "format": 1 }, { @@ -438,7 +438,7 @@ "name": "plugins/modules/vmware_cluster_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2f1c85c2da228ca18fd165303c4bf6e3820785433f8e4c4b29da5532f097ae55", + "chksum_sha256": "ed5923cdc15305e8412b05f37b6d2b0103ed9d41befbbeeb8a8598b28b0afa2a", "format": 1 }, { @@ -508,7 +508,7 @@ "name": "plugins/modules/vmware_datacenter_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "206991b567645c273700b018f4453bb777f3a182f73844a7ed658c38c9d41311", + "chksum_sha256": "12490a660df9d43092b1e3a6075f399a5895799d7d4e7909a103a27f5605e755", "format": 1 }, { @@ -536,7 +536,7 @@ "name": "plugins/modules/vmware_datastore_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "324deb8bd961b7c4834f581d1979ab0aba69e7a7e82879f060a4b37ec2a4edda", + "chksum_sha256": "39a6da2a806ee94b1ad41676287541052a9e30f5e0b808de9ae9ed5da78185e3", "format": 1 }, { @@ -592,7 +592,7 @@ "name": "plugins/modules/vmware_dvs_portgroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "62e5113c13f94cb054db298f8e7ba9ea775fab8f7b148312f2837ffcd68c4eba", + "chksum_sha256": "f72f4e7664b47113e421c73620d2f2950d87f1482ab488af450b879acae509cb", "format": 1 }, { @@ -620,7 +620,7 @@ "name": "plugins/modules/vmware_dvswitch_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "60c4835bda0af924c470d6fa719849a1189e8877b9580e207927b82095a15b25", + "chksum_sha256": "155fbe06751bd991140d913909069ac49373e2eab87081014b31ef0d8d38c23f", "format": 1 }, { @@ -774,7 +774,7 @@ "name": "plugins/modules/vmware_guest_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "da25048b3ce8b821bb13c1c12f71546303867535cbcc8cf0957fd0d82a70d22d", + "chksum_sha256": "b76f0876359e7bb7f0f56956c1d24aaece045f725888ff85553229d14eb26c4c", "format": 1 }, { @@ -998,7 +998,7 @@ "name": "plugins/modules/vmware_host_facts.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0be83e8553f01c0feee73f3256d60828c7a599bb99828afa64ed359c30ba1bb8", + "chksum_sha256": "5ed17567e7cd480c23e384c24937a5fdb53350db9bf521a0885a5a99c0acfc98", "format": 1 }, { @@ -1376,7 +1376,7 @@ "name": "plugins/modules/vmware_vcenter_settings_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "00e24ba53faf96b10b84298e0a97b2a1915b0bb9d63e62ff0ff3ed17797bb271", + "chksum_sha256": "006aab37a213f3bc88fdbd3b1bfbcaf95cceafd466f7a539cf3ffb9364951780", "format": 1 }, { @@ -1481,7 +1481,7 @@ "name": "plugins/modules/vmware_vsan_health_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f1f1cd15f00fc30518dff21437bc09178e8e7d78746a08686f4879992f19d2a5", + "chksum_sha256": "46458bb24562c4677938db0efe562de66cb8d9b54c2d360bb00717fec4c82792", "format": 1 }, { @@ -2531,7 +2531,7 @@ "name": "tests/integration/targets/vmware_content_library_manager/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f8746ce261098f3b9959c236b65b5f905c80b90dddfb4ed53baaf5bf21cb51a1", + "chksum_sha256": "8290f7eeff6ef6efbe373acc9c4526c7a7fcb110ccdabef07a7143e3e147cf16", "format": 1 }, { @@ -2951,7 +2951,7 @@ "name": "tests/integration/targets/vmware_dvs_portgroup/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "aa654a9325a4ed0af466f17af77dbf9623cf65298d16472f1a01436ca3fa1af8", + "chksum_sha256": "884a4101577841f2fd99c3064e339630f10db088d284eb50b7214ee25cda5f2c", "format": 1 }, { @@ -7025,7 +7025,7 @@ "name": "CHANGELOG.rst", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6b2e0c075305c8d5f1b662a7533014e70ec9d1733eb79d5f70f1e024ecc06d99", + "chksum_sha256": "e2bff3adb02c855ffa4cc5c55d911169d560a30bd0825d44eac85c6a058c72dc", "format": 1 }, { @@ -7053,7 +7053,7 @@ "name": "requirements.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0925a1e635ac14a5c481a16d2e3e59ccc5b7411579ddb3a27199ae069fe7deca", + "chksum_sha256": "9e5d71254beec2adb7e2df9075aedca54b6e6dc7d13b65dfb3a38a5d81165594", "format": 1 }, { diff --git a/ansible_collections/community/vmware/MANIFEST.json b/ansible_collections/community/vmware/MANIFEST.json index d1bc8edfe..1b9ad314f 100644 --- a/ansible_collections/community/vmware/MANIFEST.json +++ b/ansible_collections/community/vmware/MANIFEST.json @@ -2,7 +2,7 @@ "collection_info": { "namespace": "community", "name": "vmware", - "version": "4.3.0", + "version": "4.4.0", "authors": [ "Ansible (https://github.com/ansible)" ], @@ -28,7 +28,7 @@ "name": "FILES.json", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "af79d3641999ba756f51b0b3c0562e0ebba66c8c764a0aff81496d5906a7398a", + "chksum_sha256": "4ee26340abe1773c12bad33eb99b9c3d9584f421dbeaeef0e19fd05add0b0f26", "format": 1 }, "format": 1 diff --git a/ansible_collections/community/vmware/changelogs/changelog.yaml b/ansible_collections/community/vmware/changelogs/changelog.yaml index 2b250b5fd..b0d9afb0a 100644 --- a/ansible_collections/community/vmware/changelogs/changelog.yaml +++ b/ansible_collections/community/vmware/changelogs/changelog.yaml @@ -130,3 +130,20 @@ releases: - 2036-missing_error_msg_in_vmware_guest.yml - 2044-error_in_adding_disk_to_vm_in_vmware_guest.yml release_date: '2024-04-20' + 4.4.0: + changes: + bugfixes: + - Clarify pyVmomi requirement (https://github.com/ansible-collections/community.vmware/pull/2071). + - vmware_cluster_dpm - Handle case where DPM config has not been initialized + yet and is None (https://github.com/ansible-collections/community.vmware/pull/2057). + - vmware_dvs_portgroup - Fix erroneously reporting a change when `port_binding` + is static and `num_ports` not specified (https://github.com/ansible-collections/community.vmware/pull/2053). + minor_changes: + - vmware_dvs_portgroup - Make `state` default to `present` instead of having + it as a required parameter (https://github.com/ansible-collections/community.vmware/pull/2055). + fragments: + - 2053-vmware_dvs_portgroup.yml + - 2055-vmware_dvs_portgroup-status_default.yml + - 2057-vmware_cluster_dpm-handle-dpm-none-config.yml + - 2071-clarify-pyvmomi-requirement.yml + release_date: '2024-05-19' diff --git a/ansible_collections/community/vmware/plugins/module_utils/vmware.py b/ansible_collections/community/vmware/plugins/module_utils/vmware.py index 12bdf5107..c2c9a4f23 100644 --- a/ansible_collections/community/vmware/plugins/module_utils/vmware.py +++ b/ansible_collections/community/vmware/plugins/module_utils/vmware.py @@ -39,11 +39,9 @@ try: from pyVim import connect from pyVmomi import vim, vmodl, VmomiSupport HAS_PYVMOMI = True - HAS_PYVMOMIJSON = hasattr(VmomiSupport, 'VmomiJSONEncoder') except ImportError: PYVMOMI_IMP_ERR = traceback.format_exc() HAS_PYVMOMI = False - HAS_PYVMOMIJSON = False from ansible.module_utils._text import to_text, to_native from ansible.module_utils.six import integer_types, iteritems, string_types, raise_from @@ -1972,9 +1970,6 @@ class PyVmomi(object): provided then all properties are deeply converted. The resulting JSON is sorted to improve human readability. - Requires upstream support from pyVmomi > 6.7.1 - (https://github.com/vmware/pyvmomi/pull/732) - Args: - obj (object): vim object - properties (list, optional): list of properties following @@ -1985,9 +1980,6 @@ class PyVmomi(object): Return: dict """ - if not HAS_PYVMOMIJSON: - self.module.fail_json(msg='The installed version of pyvmomi lacks JSON output support; need pyvmomi>6.7.1') - result = dict() if properties: for prop in properties: diff --git a/ansible_collections/community/vmware/plugins/modules/vmware_cluster_dpm.py b/ansible_collections/community/vmware/plugins/modules/vmware_cluster_dpm.py index 1215f52c3..5a63baea8 100644 --- a/ansible_collections/community/vmware/plugins/modules/vmware_cluster_dpm.py +++ b/ansible_collections/community/vmware/plugins/modules/vmware_cluster_dpm.py @@ -117,7 +117,7 @@ class VMwareCluster(PyVmomi): change_message = None changes = False - if dpm_config.enabled != self.enable_dpm: + if dpm_config is None or dpm_config.enabled != self.enable_dpm: change_message = 'DPM enabled status changes' changes = True return changes, change_message diff --git a/ansible_collections/community/vmware/plugins/modules/vmware_cluster_info.py b/ansible_collections/community/vmware/plugins/modules/vmware_cluster_info.py index 24ca77bc8..273f7a351 100644 --- a/ansible_collections/community/vmware/plugins/modules/vmware_cluster_info.py +++ b/ansible_collections/community/vmware/plugins/modules/vmware_cluster_info.py @@ -42,7 +42,7 @@ options: description: - Specify the output schema desired. - The V(summary) output schema is the legacy output from the module. - - The V(vsphere) output schema is the vSphere API class definition which requires pyvmomi>6.7.1. + - The V(vsphere) output schema is the vSphere API class definition. choices: ['summary', 'vsphere'] default: 'summary' type: str diff --git a/ansible_collections/community/vmware/plugins/modules/vmware_datacenter_info.py b/ansible_collections/community/vmware/plugins/modules/vmware_datacenter_info.py index 3b8dfc878..2d5ef8729 100644 --- a/ansible_collections/community/vmware/plugins/modules/vmware_datacenter_info.py +++ b/ansible_collections/community/vmware/plugins/modules/vmware_datacenter_info.py @@ -29,7 +29,7 @@ options: description: - Specify the output schema desired. - The V(summary) output schema is the legacy output from the module. - - The V(vsphere) output schema is the vSphere API class definition which requires pyvmomi>6.7.1. + - The V(vsphere) output schema is the vSphere API class definition. choices: ['summary', 'vsphere'] default: 'summary' type: str diff --git a/ansible_collections/community/vmware/plugins/modules/vmware_datastore_info.py b/ansible_collections/community/vmware/plugins/modules/vmware_datastore_info.py index 4c3fdc1e1..618e929c9 100644 --- a/ansible_collections/community/vmware/plugins/modules/vmware_datastore_info.py +++ b/ansible_collections/community/vmware/plugins/modules/vmware_datastore_info.py @@ -58,7 +58,6 @@ options: - Specify the output schema desired. - The 'summary' output schema is the legacy output from the module - The 'vsphere' output schema is the vSphere API class definition - which requires pyvmomi>6.7.1 choices: ['summary', 'vsphere'] default: 'summary' type: str diff --git a/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup.py b/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup.py index a7b09d0c7..fbe790be6 100644 --- a/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup.py +++ b/ansible_collections/community/vmware/plugins/modules/vmware_dvs_portgroup.py @@ -64,11 +64,12 @@ options: state: description: - Determines if the portgroup should be present or not. - required: true + required: false type: str choices: - 'present' - 'absent' + default: 'present' vlan_trunk: description: - Indicates whether this is a VLAN trunk or not. @@ -734,7 +735,7 @@ class VMwareDvsPortgroup(PyVmomi): # Check config if self.module.params['port_allocation'] != 'elastic' and self.module.params['port_binding'] != 'ephemeral': - if self.dvs_portgroup.config.numPorts != self.module.params['num_ports']: + if self.module.params['num_ports'] is not None and self.dvs_portgroup.config.numPorts != self.module.params['num_ports']: return 'update' # Default port config @@ -893,7 +894,7 @@ def main(): num_ports=dict(type='int'), port_binding=dict(required=True, type='str', choices=['static', 'ephemeral']), port_allocation=dict(type='str', choices=['fixed', 'elastic']), - state=dict(required=True, choices=['present', 'absent'], type='str'), + state=dict(type='str', choices=['present', 'absent'], default='present'), vlan_trunk=dict(type='bool', default=False), vlan_private=dict(type='bool', default=False), network_policy=dict( diff --git a/ansible_collections/community/vmware/plugins/modules/vmware_dvswitch_info.py b/ansible_collections/community/vmware/plugins/modules/vmware_dvswitch_info.py index b4fa9c7c3..7e3a3b082 100644 --- a/ansible_collections/community/vmware/plugins/modules/vmware_dvswitch_info.py +++ b/ansible_collections/community/vmware/plugins/modules/vmware_dvswitch_info.py @@ -43,7 +43,6 @@ options: - Specify the output schema desired. - The 'summary' output schema is the legacy output from the module - The 'vsphere' output schema is the vSphere API class definition - which requires pyvmomi>6.7.1 choices: ['summary', 'vsphere'] default: 'summary' type: str diff --git a/ansible_collections/community/vmware/plugins/modules/vmware_guest_info.py b/ansible_collections/community/vmware/plugins/modules/vmware_guest_info.py index 470f76642..4f3678e37 100644 --- a/ansible_collections/community/vmware/plugins/modules/vmware_guest_info.py +++ b/ansible_collections/community/vmware/plugins/modules/vmware_guest_info.py @@ -87,7 +87,6 @@ options: - Specify the output schema desired. - The V(summary) output schema is the legacy output from the module - The V(vsphere) output schema is the vSphere API class definition - which requires pyvmomi>6.7.1 choices: ['summary', 'vsphere'] default: 'summary' type: str diff --git a/ansible_collections/community/vmware/plugins/modules/vmware_host_facts.py b/ansible_collections/community/vmware/plugins/modules/vmware_host_facts.py index a4738b117..1bfd64012 100644 --- a/ansible_collections/community/vmware/plugins/modules/vmware_host_facts.py +++ b/ansible_collections/community/vmware/plugins/modules/vmware_host_facts.py @@ -47,7 +47,6 @@ options: - Specify the output schema desired. - The V(summary) output schema is the legacy output from the module - The V(vsphere) output schema is the vSphere API class definition - which requires pyvmomi>6.7.1 choices: ['summary', 'vsphere'] default: 'summary' type: str diff --git a/ansible_collections/community/vmware/plugins/modules/vmware_vcenter_settings_info.py b/ansible_collections/community/vmware/plugins/modules/vmware_vcenter_settings_info.py index 3936cc770..183a58244 100644 --- a/ansible_collections/community/vmware/plugins/modules/vmware_vcenter_settings_info.py +++ b/ansible_collections/community/vmware/plugins/modules/vmware_vcenter_settings_info.py @@ -22,7 +22,7 @@ options: description: - Specify the output schema desired. - The 'summary' output schema is the legacy output from the module. - - The 'vsphere' output schema is the vSphere API class definition which requires pyvmomi>6.7.1. + - The 'vsphere' output schema is the vSphere API class definition. choices: ['summary', 'vsphere'] default: 'summary' type: str diff --git a/ansible_collections/community/vmware/plugins/modules/vmware_vsan_health_info.py b/ansible_collections/community/vmware/plugins/modules/vmware_vsan_health_info.py index 565b2b859..7a6b68735 100644 --- a/ansible_collections/community/vmware/plugins/modules/vmware_vsan_health_info.py +++ b/ansible_collections/community/vmware/plugins/modules/vmware_vsan_health_info.py @@ -108,11 +108,9 @@ import traceback try: from pyVmomi import vmodl, VmomiSupport HAS_PYVMOMI = True - HAS_PYVMOMIJSON = hasattr(VmomiSupport, 'VmomiJSONEncoder') except ImportError: PYVMOMI_IMP_ERR = traceback.format_exc() HAS_PYVMOMI = False - HAS_PYVMOMIJSON = False VSANPYTHONSDK_IMP_ERR = None try: @@ -186,9 +184,6 @@ def main(): if not HAS_VSANPYTHONSDK: module.fail_json(msg=missing_required_lib('vSAN Management SDK for Python'), exception=VSANPYTHONSDK_IMP_ERR) - if not HAS_PYVMOMIJSON: - module.fail_json(msg='The installed version of pyvmomi lacks JSON output support; need pyvmomi>6.7.1') - vsan_info_manager = VSANInfoManager(module) vsan_info_manager.gather_info() diff --git a/ansible_collections/community/vmware/requirements.txt b/ansible_collections/community/vmware/requirements.txt index cca52e3da..c2bbb7911 100644 --- a/ansible_collections/community/vmware/requirements.txt +++ b/ansible_collections/community/vmware/requirements.txt @@ -1,2 +1,2 @@ -pyVmomi>=6.7 +pyVmomi>=6.7.1 git+https://github.com/vmware/vsphere-automation-sdk-python.git ; python_version >= '2.7' # Python 2.6 is not supported diff --git a/ansible_collections/community/vmware/tests/integration/targets/vmware_content_library_manager/tasks/main.yml b/ansible_collections/community/vmware/tests/integration/targets/vmware_content_library_manager/tasks/main.yml index c12b57b57..86b00dc85 100644 --- a/ansible_collections/community/vmware/tests/integration/targets/vmware_content_library_manager/tasks/main.yml +++ b/ansible_collections/community/vmware/tests/integration/targets/vmware_content_library_manager/tasks/main.yml @@ -100,7 +100,7 @@ state: absent - name: get finger print - shell: echo | openssl s_client -connect wp-content.vmware.com:443 |& openssl x509 -fingerprint -noout + shell: echo | openssl s_client -connect wp-content.broadcom.com:443 |& openssl x509 -fingerprint -noout register: _finger_print - debug: var=_finger_print @@ -113,7 +113,7 @@ validate_certs: false library_name: Sample_Subscribed_Library library_description: Sample Description - subscription_url: "https://wp-content.vmware.com/v2/latest/lib.json" + subscription_url: "https://wp-content.broadcom.com/v2/latest/lib.json" update_on_demand: true library_type: subscribed ssl_thumbprint: '{{ _finger_print.stdout.split("=")[1] }}' @@ -144,7 +144,7 @@ validate_certs: false library_name: Sample_Subscribed_Library library_description: Update Sample Description - subscription_url: https://download3.vmware.com/software/vmw-tools/lib.json + subscription_url: "https://wp-content.broadcom.com/v2/latest/lib.json" update_on_demand: true library_type: subscribed ssl_thumbprint: '{{ _finger_print.stdout.split("=")[1] }}' diff --git a/ansible_collections/community/vmware/tests/integration/targets/vmware_dvs_portgroup/tasks/main.yml b/ansible_collections/community/vmware/tests/integration/targets/vmware_dvs_portgroup/tasks/main.yml index 8d45b2e28..2feff488c 100644 --- a/ansible_collections/community/vmware/tests/integration/targets/vmware_dvs_portgroup/tasks/main.yml +++ b/ansible_collections/community/vmware/tests/integration/targets/vmware_dvs_portgroup/tasks/main.yml @@ -805,3 +805,85 @@ - assert: that: - delete_test_dvs_port_group_issues_637_idempotency_check_result.changed is sameas true + +- name: Create portgroup for num_ports check + community.vmware.vmware_dvs_portgroup: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + validate_certs: false + portgroup_name: "portgroup2053" + switch_name: "{{ dvswitch1 }}" + vlan_id: 2053 + port_binding: static + register: create_portgroup2053_result + +- assert: + that: + - create_portgroup2053_result is changed + +- name: Check idempotency for unspecified num_ports + community.vmware.vmware_dvs_portgroup: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + validate_certs: false + portgroup_name: "portgroup2053" + switch_name: "{{ dvswitch1 }}" + vlan_id: 2053 + port_binding: static + register: portgroup2053_check1_result + +- assert: + that: + - portgroup2053_check1_result is not changed + +- name: Update for num_ports + community.vmware.vmware_dvs_portgroup: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + validate_certs: false + portgroup_name: "portgroup2053" + switch_name: "{{ dvswitch1 }}" + vlan_id: 2053 + port_binding: static + num_ports: 8 + register: portgroup2053_check2_result + +- assert: + that: + - portgroup2053_check2_result is changed + +- name: Check idempotency for unspecified num_ports + community.vmware.vmware_dvs_portgroup: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + validate_certs: false + portgroup_name: "portgroup2053" + switch_name: "{{ dvswitch1 }}" + vlan_id: 2053 + port_binding: static + register: portgroup2053_check3_result + +- assert: + that: + - portgroup2053_check3_result is not changed + +- name: Delete num_ports check portgroup + community.vmware.vmware_dvs_portgroup: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + validate_certs: false + portgroup_name: "portgroup2053" + switch_name: "{{ dvswitch1 }}" + vlan_id: 2053 + port_binding: static + state: absent + register: delete_portgroup2053_result + +- assert: + that: + - delete_portgroup2053_result is changed |