Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemorency committed Dec 16, 2024
1 parent f122219 commit b53e602
Showing 1 changed file with 87 additions and 87 deletions.
174 changes: 87 additions & 87 deletions plugins/inventory/vmware_esxi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,92 +7,92 @@
__metaclass__ = type

DOCUMENTATION = r"""
name: vmware_esxi_hosts
short_description: Create an inventory containing VMware ESXi hosts
author:
- Ansible Cloud Team (@ansible-collections)
description:
- Create a dynamic inventory of VMware ESXi hosts from a vCenter environment.
- Uses any file which ends with esxi_hosts.yml, esxi_hosts.yaml, vmware_esxi_hosts.yml, or vmware_esxi_hosts.yaml as a YAML configuration file.
extends_documentation_fragment:
- vmware.vmware.base_options
- vmware.vmware.additional_rest_options
- vmware.vmware.plugin_base_options
- ansible.builtin.inventory_cache
- ansible.builtin.constructed
requirements:
- vSphere Automation SDK (when gather_tags is True)
options:
gather_tags:
description:
- If true, gather any tags attached to the associated ESXi hosts
- Requires 'vSphere Automation SDK' library to be installed on the Ansible controller machine.
default: false
type: bool
hostnames:
description:
- A list of templates evaluated in order to compose inventory_hostname.
- Each value in the list should be a jinja template. You can see the examples section for more details.
- Templates that result in an empty string or None value are ignored and the next template is evaluated.
- You can use hostvars such as properties specified in O(properties) as variables in the template.
type: list
elements: string
default: ['name']
properties:
description:
- Specify a list of VMware schema properties associated with the ESXi hostsystem to collectio and return as hostvars.
- Each value in the list can be a path to a specific property in hostsystem object or a path to a collection of hostsystem objects.
- Please make sure that if you use a property in another parameter that is is included in this option.
- Some properties are always returned, such as name, customValue, and summary.runtime.powerState
- Use V(all) to return all properties available for the ESXi host.
type: list
elements: string
default: ['name', 'customValue', 'summary.runtime.powerState']
flatten_nested_properties:
description:
- If true, flatten any nested properties into their dot notation names.
- For example 'summary["runtime"]["powerState"]' would become "summary.runtime.powerState"
type: bool
default: false
keyed_groups:
description:
- Use the values of ESXi host properties or other hostvars to create and populate groups.
type: list
default: [{key: 'summary.runtime.powerState', separator: ''}]
search_paths:
description:
- Specify a list of paths that should be searched recursively for hosts.
- This effectively allows you to only include hosts in certain datacenters, clusters, or folders.
- >-
Filtering is done before the initial host gathering query. If you have a large number of hosts, specifying
a subset of paths to search can help speed up the inventory plugin.
- The default value is an empty list, which means all paths (i.e. all datacenters) will be searched.
type: list
elements: str
default: []
group_by_path:
description:
- If true, groups will be created based on the ESXI hosts' paths.
- Any slashes in the paths will be replaced by underscores in the group names.
- A group is created for each step down in the path, with the group from the step above containing subsequent groups.
- For example, a path /DC/hosts/Cluster will create groups 'DC' which contains group 'DC_hosts' which contains group 'DC_hosts_Cluster'
default: false
type: bool
group_by_path_prefix:
description:
- If O(group_by_path) is true, set this variable if you want to add a prefix to any groups created based on paths.
- By default, no prefix is added to the group names.
default: ''
type: str
sanitize_property_names:
description:
- If true, sanitize ESXi host property names so they can safely be referenced within Ansible playbooks.
- This option also transforms property names to snake case. For example, powerState would become power_state.
type: bool
default: false
name: esxi_hosts
short_description: Create an inventory containing VMware ESXi hosts
author:
- Ansible Cloud Team (@ansible-collections)
description:
- Create a dynamic inventory of VMware ESXi hosts from a vCenter environment.
- Uses any file which ends with esxi_hosts.yml, esxi_hosts.yaml, vmware_esxi_hosts.yml, or vmware_esxi_hosts.yaml as a YAML configuration file.
extends_documentation_fragment:
- vmware.vmware.base_options
- vmware.vmware.additional_rest_options
- vmware.vmware.plugin_base_options
- ansible.builtin.inventory_cache
- ansible.builtin.constructed
requirements:
- vSphere Automation SDK (when gather_tags is True)
options:
gather_tags:
description:
- If true, gather any tags attached to the associated ESXi hosts
- Requires 'vSphere Automation SDK' library to be installed on the Ansible controller machine.
default: false
type: bool
hostnames:
description:
- A list of templates evaluated in order to compose inventory_hostname.
- Each value in the list should be a jinja template. You can see the examples section for more details.
- Templates that result in an empty string or None value are ignored and the next template is evaluated.
- You can use hostvars such as properties specified in O(properties) as variables in the template.
type: list
elements: string
default: ['name']
properties:
description:
- Specify a list of VMware schema properties associated with the ESXi hostsystem to collectio and return as hostvars.
- Each value in the list can be a path to a specific property in hostsystem object or a path to a collection of hostsystem objects.
- Please make sure that if you use a property in another parameter that is is included in this option.
- Some properties are always returned, such as name, customValue, and summary.runtime.powerState
- Use V(all) to return all properties available for the ESXi host.
type: list
elements: string
default: ['name', 'customValue', 'summary.runtime.powerState']
flatten_nested_properties:
description:
- If true, flatten any nested properties into their dot notation names.
- For example 'summary["runtime"]["powerState"]' would become "summary.runtime.powerState"
type: bool
default: false
keyed_groups:
description:
- Use the values of ESXi host properties or other hostvars to create and populate groups.
type: list
default: [{key: 'summary.runtime.powerState', separator: ''}]
search_paths:
description:
- Specify a list of paths that should be searched recursively for hosts.
- This effectively allows you to only include hosts in certain datacenters, clusters, or folders.
- >-
Filtering is done before the initial host gathering query. If you have a large number of hosts, specifying
a subset of paths to search can help speed up the inventory plugin.
- The default value is an empty list, which means all paths (i.e. all datacenters) will be searched.
type: list
elements: str
default: []
group_by_path:
description:
- If true, groups will be created based on the ESXI hosts' paths.
- Any slashes in the paths will be replaced by underscores in the group names.
- A group is created for each step down in the path, with the group from the step above containing subsequent groups.
- For example, a path /DC/hosts/Cluster will create groups 'DC' which contains group 'DC_hosts' which contains group 'DC_hosts_Cluster'
default: false
type: bool
group_by_path_prefix:
description:
- If O(group_by_path) is true, set this variable if you want to add a prefix to any groups created based on paths.
- By default, no prefix is added to the group names.
default: ''
type: str
sanitize_property_names:
description:
- If true, sanitize ESXi host property names so they can safely be referenced within Ansible playbooks.
- This option also transforms property names to snake case. For example, powerState would become power_state.
type: bool
default: false
"""

EXAMPLES = r"""
Expand Down Expand Up @@ -244,7 +244,7 @@ def management_ip(self):

class InventoryModule(VmwareInventoryBase):

NAME = "vmware.vmware.vmware_esxi_hosts"
NAME = "vmware.vmware.esxi_hosts"

def verify_file(self, path):
"""
Expand Down

0 comments on commit b53e602

Please sign in to comment.