From 7d61ba7eb203422e567b785403ab7d53894a95f9 Mon Sep 17 00:00:00 2001 From: Mario Lenz Date: Fri, 29 Nov 2024 18:38:19 +0100 Subject: [PATCH] Deprecate vmware_cluster_info --- .github/workflows/extra-docs-linting.yml | 2 +- .../2260-deprecate-vmware_cluster_info.yml | 3 + meta/runtime.yml | 4 + plugins/modules/vmware_cluster_info.py | 4 + .../targets/vmware_cluster_info/aliases | 3 - .../vmware_cluster_info/tasks/main.yml | 194 ------------------ 6 files changed, 12 insertions(+), 198 deletions(-) create mode 100644 changelogs/fragments/2260-deprecate-vmware_cluster_info.yml delete mode 100644 tests/integration/targets/vmware_cluster_info/aliases delete mode 100644 tests/integration/targets/vmware_cluster_info/tasks/main.yml diff --git a/.github/workflows/extra-docs-linting.yml b/.github/workflows/extra-docs-linting.yml index 1d1cafd43b..782fd9c928 100644 --- a/.github/workflows/extra-docs-linting.yml +++ b/.github/workflows/extra-docs-linting.yml @@ -34,7 +34,7 @@ jobs: - name: Install dependent collections run: > ansible-galaxy collection install - 'vmware.vmware>=1.6.0' + 'vmware.vmware>=1.7.1' - name: Run collection docs linter run: antsibull-docs lint-collection-docs . --plugin-docs --skip-rstcheck diff --git a/changelogs/fragments/2260-deprecate-vmware_cluster_info.yml b/changelogs/fragments/2260-deprecate-vmware_cluster_info.yml new file mode 100644 index 0000000000..72ae37c7a1 --- /dev/null +++ b/changelogs/fragments/2260-deprecate-vmware_cluster_info.yml @@ -0,0 +1,3 @@ +deprecated_features: + - vmware_cluster_info - the module has been deprecated and will be removed in community.vmware 7.0.0 + (https://github.com/ansible-collections/community.vmware/pull/2260). diff --git a/meta/runtime.yml b/meta/runtime.yml index 1709700bf0..6a46b594b9 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -197,6 +197,10 @@ plugin_routing: deprecation: removal_version: 6.0.0 warning_text: Use vmware.vmware.cluster_drs_recommendations instead. + vmware_cluster_info: + deprecation: + removal_version: 7.0.0 + warning_text: Use vmware.vmware.cluster_info instead. vmware_cluster_vcls: deprecation: removal_version: 6.0.0 diff --git a/plugins/modules/vmware_cluster_info.py b/plugins/modules/vmware_cluster_info.py index 273f7a351d..18ac7608bf 100644 --- a/plugins/modules/vmware_cluster_info.py +++ b/plugins/modules/vmware_cluster_info.py @@ -13,6 +13,10 @@ DOCUMENTATION = r''' --- module: vmware_cluster_info +deprecated: + removed_in: 7.0.0 + why: This module has been moved to the L(new vmware.vmware collection,https://forum.ansible.com/t/5880) + alternative: Use M(vmware.vmware.cluster_info) instead. short_description: Gather info about clusters available in given vCenter description: - This module can be used to gather information about clusters in VMWare infrastructure. diff --git a/tests/integration/targets/vmware_cluster_info/aliases b/tests/integration/targets/vmware_cluster_info/aliases deleted file mode 100644 index b1682114ea..0000000000 --- a/tests/integration/targets/vmware_cluster_info/aliases +++ /dev/null @@ -1,3 +0,0 @@ -cloud/vcenter -needs/target/prepare_vmware_tests -zuul/vmware/vcenter_only diff --git a/tests/integration/targets/vmware_cluster_info/tasks/main.yml b/tests/integration/targets/vmware_cluster_info/tasks/main.yml deleted file mode 100644 index 834785d91b..0000000000 --- a/tests/integration/targets/vmware_cluster_info/tasks/main.yml +++ /dev/null @@ -1,194 +0,0 @@ -# Test code for the vmware_cluster_info module. -# Copyright: (c) 2018, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -- import_role: - name: prepare_vmware_tests - -- &vc_all_data - name: gather info about all clusters in the given datacenter - vmware_cluster_info: - hostname: "{{ vcenter_hostname }}" - username: "{{ vcenter_username }}" - password: "{{ vcenter_password }}" - validate_certs: false - datacenter: "{{ dc1 }}" - register: all_cluster_result - -- &ensure_vc_all_data - name: ensure info are gathered for all clusters - assert: - that: - - all_cluster_result.clusters - - not all_cluster_result.changed - -- name: ensure info are all defined - assert: - that: - - all_cluster_result.clusters[item].datacenter is defined - - all_cluster_result.clusters[item].hosts is defined - - all_cluster_result.clusters[item].enable_ha is defined - - all_cluster_result.clusters[item].ha_failover_level is defined - - all_cluster_result.clusters[item].ha_vm_monitoring is defined - - all_cluster_result.clusters[item].ha_host_monitoring is defined - - all_cluster_result.clusters[item].ha_admission_control_enabled is defined - - all_cluster_result.clusters[item].ha_restart_priority is defined - - all_cluster_result.clusters[item].ha_vm_tools_monitoring is defined - - all_cluster_result.clusters[item].ha_vm_min_up_time is defined - - all_cluster_result.clusters[item].ha_vm_max_failures is defined - - all_cluster_result.clusters[item].ha_vm_max_failure_window is defined - - all_cluster_result.clusters[item].ha_vm_failure_interval is defined - - all_cluster_result.clusters[item].enabled_drs is defined - - all_cluster_result.clusters[item].drs_enable_vm_behavior_overrides is defined - - all_cluster_result.clusters[item].drs_default_vm_behavior is defined - - all_cluster_result.clusters[item].drs_vmotion_rate is defined - - all_cluster_result.clusters[item].enabled_vsan is defined - - all_cluster_result.clusters[item].vsan_auto_claim_storage is defined - - all_cluster_result.clusters[item].tags is defined - - all_cluster_result.clusters[item].resource_summary is defined - - all_cluster_result.clusters[item].moid is defined - loop: "{{ all_cluster_result.clusters.keys() }}" - -- <<: *vc_all_data - name: Gather info about all clusters in the given datacenter in check mode - check_mode: true - -- debug: msg=all_cluster_result - -- <<: *ensure_vc_all_data - name: Ensure info is gathered for all clusters in check mode - -- &vc_cluster_data - name: Gather info about the given cluster - vmware_cluster_info: - hostname: "{{ vcenter_hostname }}" - username: "{{ vcenter_username }}" - password: "{{ vcenter_password }}" - validate_certs: false - cluster_name: "{{ ccr1 }}" - register: cluster_result - -- &ensure_vc_cluster_data - name: Ensure info are gathered for the given cluster - assert: - that: - - cluster_result.clusters - - not cluster_result.changed - -- <<: *vc_cluster_data - name: Gather info about the given cluster in check mode - check_mode: true - -- <<: *ensure_vc_cluster_data - name: Ensure info is gathered for the given cluster in check mode - -- name: Gather info about all clusters in the given datacenter with properties - vmware_cluster_info: - hostname: "{{ vcenter_hostname }}" - username: "{{ vcenter_username }}" - password: "{{ vcenter_password }}" - validate_certs: false - datacenter: "{{ dc1 }}" - schema: vsphere - properties: - - name - - configuration.dasConfig.enabled - - summary.totalCpu - register: all_cluster_result - -- name: Ensure info are gathered for all clusters with properteis - assert: - that: - - all_cluster_result.clusters - - all_cluster_result.clusters[item].name == item - - all_cluster_result.clusters[item].configuration.dasConfig.enabled is defined - - all_cluster_result.clusters[item].summary.totalCpu is defined - - not all_cluster_result.changed - loop: "{{ all_cluster_result.clusters.keys() }}" - -- name: Gather info about the given cluster with properties - vmware_cluster_info: - hostname: "{{ vcenter_hostname }}" - username: "{{ vcenter_username }}" - password: "{{ vcenter_password }}" - validate_certs: false - cluster_name: "{{ ccr1 }}" - schema: vsphere - properties: - - name - - configuration.dasConfig.enabled - - summary.totalCpu - register: cluster_result - -- name: Ensure info are gathered for the given cluster with properties - assert: - that: - - cluster_result.clusters - - cluster_result.clusters[item].name == item - - cluster_result.clusters[item].configuration.dasConfig.enabled is defined - - cluster_result.clusters[item].summary.totalCpu is defined - - not cluster_result.changed - loop: "{{ cluster_result.clusters.keys() }}" - -# Disabled until we get a fix for https://github.com/ansible-collections/vmware/issues/301 -# - import_role: -# name: prepare_vmware_tests -# vars: -# setup_category: true -# setup_tag: true - -# - name: Apply tag to cluster -# vmware_tag_manager: -# hostname: "{{ vcenter_hostname }}" -# username: "{{ vcenter_username }}" -# password: "{{ vcenter_password }}" -# validate_certs: false -# tag_names: -# - '{{ cluster_category }}:{{ cluster_tag }}' -# state: present -# object_name: '{{ ccr1 }}' -# object_type: ClusterComputeResource - -# - name: Get info about cluster -# vmware_cluster_info: -# hostname: "{{ vcenter_hostname }}" -# username: "{{ vcenter_username }}" -# password: "{{ vcenter_password }}" -# validate_certs: false -# show_tag: true -# cluster_name: "{{ ccr1 }}" -# register: cluster_info - -# - assert: -# that: -# - cluster_info is defined -# - cluster_info.clusters[ccr1].tags is defined - -- name: "Prepare a cluster name with character to be URL-encoded" - vmware.vmware.cluster: - hostname: "{{ vcenter_hostname }}" - username: "{{ vcenter_username }}" - password: "{{ vcenter_password }}" - validate_certs: false - datacenter_name: "{{ dc1 }}" - cluster_name: 'Cluster/\%' - state: present - register: prepare_cluster_url_encoded_result - -- assert: - that: - - prepare_cluster_url_encoded_result.changed is sameas true - -- name: "Gather information about all datacenter" - vmware_cluster_info: - hostname: "{{ vcenter_hostname }}" - username: "{{ vcenter_username }}" - password: "{{ vcenter_password }}" - validate_certs: false - datacenter: "{{ dc1 }}" - register: all_cluster_result - -- name: "Ensure URL-encoded cluster name" - assert: - that: - - all_cluster_result.clusters['Cluster/\%']