From c44b05e1674a9cb2d445654e6e4a751fcd56fe5c Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 31 Jul 2018 16:11:16 +0530 Subject: [PATCH] VMware: update documentation and example (#43474) This fix updates the documenation of vmware_guest_custom_attribute_defs module. Fixes: #43443 Signed-off-by: Abhijeet Kasurde --- .../vmware_guest_custom_attribute_defs.py | 29 +++++-------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest_custom_attribute_defs.py b/lib/ansible/modules/cloud/vmware/vmware_guest_custom_attribute_defs.py index 3f1181f3450..7b386df3f4f 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest_custom_attribute_defs.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest_custom_attribute_defs.py @@ -20,11 +20,11 @@ DOCUMENTATION = ''' module: vmware_guest_custom_attribute_defs short_description: Manage custom attributes definitions for virtual machine from VMWare description: - - This module can be used to add, remove and list custom attributes definitions for the given virtual machine from VMWare. + - This module can be used to add and remove custom attributes definitions for the given virtual machine from VMWare. version_added: 2.7 author: - Jimmy Conner - - Abhijeet Kasurde (@Akasurde) + - Abhijeet Kasurde (@Akasurde) notes: - Tested on vSphere 6.5 requirements: @@ -50,22 +50,11 @@ extends_documentation_fragment: vmware.documentation ''' EXAMPLES = ''' -- name: List VMWare Attribute Definitions - vmware_guest_custom_attribute_defs: - hostname: 192.168.1.209 - username: administrator@vsphere.local - password: vmware - validate_certs: no - state: list - delegate_to: localhost - register: defs - - name: Add VMWare Attribute Definition vmware_guest_custom_attribute_defs: - hostname: 192.168.1.209 - username: administrator@vsphere.local - password: vmware - validate_certs: no + hostname: "{{ vcenter_server }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" state: present attribute_key: custom_attr_def_1 delegate_to: localhost @@ -73,10 +62,9 @@ EXAMPLES = ''' - name: Remove VMWare Attribute Definition vmware_guest_custom_attribute_defs: - hostname: 192.168.1.209 - username: administrator@vsphere.local - password: vmware - validate_certs: no + hostname: "{{ vcenter_server }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" state: absent attribute_key: custom_attr_def_1 delegate_to: localhost @@ -95,7 +83,6 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec try: - import pyVmomi from pyVmomi import vim except ImportError: pass