|
10 | 10 | from __future__ import absolute_import, division, print_function
|
11 | 11 | __metaclass__ = type
|
12 | 12 |
|
13 |
| -import re |
14 |
| - |
15 | 13 | DOCUMENTATION = r'''
|
16 | 14 | ---
|
17 | 15 | module: vmware_vm_info
|
|
40 | 38 | folder:
|
41 | 39 | description:
|
42 | 40 | - Specify a folder location of VMs to gather information from.
|
43 |
| - - Can't be used if V(cluster) is set. |
| 41 | + - Can't be used if O(cluster) is set. |
44 | 42 | - 'Examples:'
|
45 | 43 | - ' folder: /ha-datacenter/vm'
|
46 | 44 | - ' folder: ha-datacenter/vm'
|
|
52 | 50 | - ' folder: folder1/datacenter1/vm'
|
53 | 51 | - ' folder: /folder1/datacenter1/vm/folder2'
|
54 | 52 | type: str
|
55 |
| - vm_name: |
56 |
| - description: |
57 |
| - - Name of the virtual machine to get related configurations information from. |
58 |
| - - Or if V(regex) is True, it will be used as an Filter for the Names of the virtual machines. |
59 |
| - - Can´t be used if V(cluster) or V(vm_names) is set. |
60 |
| - type: str |
61 | 53 | vm_names:
|
62 | 54 | description:
|
63 | 55 | - List of the names of the virtual machines to get related configurations information from.
|
64 |
| - - Can´t be used if V(regex) is set. |
| 56 | + - Can´t be used if O(regex) is set. |
65 | 57 | type: list
|
66 | 58 | element: str
|
| 59 | + vm_name: |
| 60 | + description: |
| 61 | + - Name of the virtual machine to get related configurations information from. |
| 62 | + - Or if O(regex) is True, it will be used as an Filter for the Names of the virtual machines. |
| 63 | + - Can´t be used if O(cluster) or O(vm_names) is set. |
| 64 | + type: str |
67 | 65 | show_cluster:
|
68 | 66 | description:
|
69 | 67 | - Tags virtual machine's cluster is shown if set to V(true).
|
|
129 | 127 | type: bool
|
130 | 128 | regex:
|
131 | 129 | description:
|
132 |
| - - If V(vm_name) is used as an Regex Filter. |
133 |
| - - For Metacharacters use in the V(vm_name) show Python RegEx |
| 130 | + - If O(vm_name) is used as an Regex Filter. |
| 131 | + - For Metacharacters use in the O(vm_name) show Python RegEx |
134 | 132 | type: bool
|
135 |
| - default: False |
| 133 | + default: false |
136 | 134 | cluster:
|
137 | 135 | description:
|
138 | 136 | - Name of the cluster to gather information from VMs of this cluster.
|
|
331 | 329 | from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, \
|
332 | 330 | get_all_objs, vmware_argument_spec, _get_vm_prop, get_parent_datacenter, find_vm_by_name, find_cluster_by_name
|
333 | 331 | from ansible_collections.community.vmware.plugins.module_utils.vmware_rest_client import VmwareRestClient
|
| 332 | +import re |
334 | 333 |
|
335 | 334 |
|
336 | 335 | class VmwareVmInfo(PyVmomi):
|
|
0 commit comments