From 216d8b525434bd5d7dfbeabd20e7824a742938a8 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 30 Apr 2019 16:39:21 +0530 Subject: [PATCH] VMware: support check mode in all facts modules (#55689) * vmware_cluster_facts * vmware_guest_facts * vmware_guest_snapshot_facts * vmware_host_capability_facts * vmware_host_package_facts * vmware_target_canonical_facts Signed-off-by: Abhijeet Kasurde --- lib/ansible/modules/cloud/vmware/vmware_cluster_facts.py | 1 + lib/ansible/modules/cloud/vmware/vmware_guest_facts.py | 3 ++- .../modules/cloud/vmware/vmware_guest_snapshot_facts.py | 1 + .../modules/cloud/vmware/vmware_host_capability_facts.py | 3 ++- lib/ansible/modules/cloud/vmware/vmware_host_package_facts.py | 3 ++- .../modules/cloud/vmware/vmware_target_canonical_facts.py | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_cluster_facts.py b/lib/ansible/modules/cloud/vmware/vmware_cluster_facts.py index f20d44ffc36..a74a2b9c9c5 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_cluster_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_cluster_facts.py @@ -215,6 +215,7 @@ def main(): required_one_of=[ ['cluster_name', 'datacenter'], ], + supports_check_mode=True, ) pyv = VmwreClusterFactsManager(module) pyv.gather_cluster_facts() diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest_facts.py b/lib/ansible/modules/cloud/vmware/vmware_guest_facts.py index a9d6bc9749c..922c51b7f31 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest_facts.py @@ -229,7 +229,8 @@ def main(): properties=dict(type='list') ) module = AnsibleModule(argument_spec=argument_spec, - required_one_of=[['name', 'uuid']]) + required_one_of=[['name', 'uuid']], + supports_check_mode=True) if module.params.get('folder'): # FindByInventoryPath() does not require an absolute path diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest_snapshot_facts.py b/lib/ansible/modules/cloud/vmware/vmware_guest_snapshot_facts.py index 55d4f2e5397..8a2fe7e1cb0 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest_snapshot_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest_snapshot_facts.py @@ -138,6 +138,7 @@ def main(): module = AnsibleModule(argument_spec=argument_spec, required_together=[['name', 'folder']], required_one_of=[['name', 'uuid']], + supports_check_mode=True, ) if module.params['folder']: diff --git a/lib/ansible/modules/cloud/vmware/vmware_host_capability_facts.py b/lib/ansible/modules/cloud/vmware/vmware_host_capability_facts.py index 0d7431c3a4c..767bf15828e 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_host_capability_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_host_capability_facts.py @@ -207,7 +207,8 @@ def main(): argument_spec=argument_spec, required_one_of=[ ['cluster_name', 'esxi_hostname'], - ] + ], + supports_check_mode=True, ) host_capability_manager = CapabilityFactsManager(module) diff --git a/lib/ansible/modules/cloud/vmware/vmware_host_package_facts.py b/lib/ansible/modules/cloud/vmware/vmware_host_package_facts.py index 9cba7f6ed72..d0178957d94 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_host_package_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_host_package_facts.py @@ -114,7 +114,8 @@ def main(): argument_spec=argument_spec, required_one_of=[ ['cluster_name', 'esxi_hostname'], - ] + ], + supports_check_mode=True, ) vmware_host_package_config = VmwarePackageManager(module) diff --git a/lib/ansible/modules/cloud/vmware/vmware_target_canonical_facts.py b/lib/ansible/modules/cloud/vmware/vmware_target_canonical_facts.py index a40fe56a6d2..ad6136c9884 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_target_canonical_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_target_canonical_facts.py @@ -171,6 +171,7 @@ def main(): required_one_of=[ ['cluster_name', 'esxi_hostname'], ], + supports_check_mode=True, ) scsi_tgt_manager = ScsiTargetFactsManager(module)