2016-05-31 02:41:48 +02:00
|
|
|
# Ansible VMware external inventory script settings
|
|
|
|
|
|
|
|
[vmware]
|
|
|
|
|
|
|
|
# The resolvable hostname or ip address of the vsphere
|
|
|
|
server=vcenter
|
|
|
|
|
|
|
|
# The port for the vsphere API
|
2016-09-13 15:58:06 +02:00
|
|
|
#port=443
|
2016-05-31 02:41:48 +02:00
|
|
|
|
2017-01-10 15:09:11 +01:00
|
|
|
# The username with access to the vsphere API. This setting
|
|
|
|
# may also be defined via the VMWARE_USERNAME environment variable.
|
2016-05-31 02:41:48 +02:00
|
|
|
username=administrator@vsphere.local
|
|
|
|
|
2017-01-10 15:09:11 +01:00
|
|
|
# The password for the vsphere API. This setting
|
|
|
|
# may also be defined via the VMWARE_PASSWORD environment variable.
|
2016-05-31 02:41:48 +02:00
|
|
|
password=vmware
|
|
|
|
|
2016-09-30 15:06:02 +02:00
|
|
|
# Verify the server's SSL certificate
|
|
|
|
#validate_certs = True
|
|
|
|
|
2016-05-31 02:41:48 +02:00
|
|
|
# Specify the number of seconds to use the inventory cache before it is
|
|
|
|
# considered stale. If not defined, defaults to 0 seconds.
|
|
|
|
#cache_max_age = 3600
|
|
|
|
|
|
|
|
|
|
|
|
# Specify the directory used for storing the inventory cache. If not defined,
|
|
|
|
# caching will be disabled.
|
2016-08-01 23:34:06 +02:00
|
|
|
#cache_path = ~/.cache/ansible
|
2016-05-31 02:41:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Max object level refers to the level of recursion the script will delve into
|
2017-01-10 15:09:11 +01:00
|
|
|
# the objects returned from pyvomi to find serializable facts. The default
|
|
|
|
# level of 0 is sufficient for most tasks and will be the most performant.
|
2016-05-31 02:41:48 +02:00
|
|
|
# Beware that the recursion can exceed python's limit (causing traceback),
|
|
|
|
# cause sluggish script performance and return huge blobs of facts.
|
|
|
|
# If you do not know what you are doing, leave this set to 1.
|
|
|
|
#max_object_level=1
|
|
|
|
|
|
|
|
|
|
|
|
# Lower the keynames for facts to make addressing them easier.
|
|
|
|
#lower_var_keys=True
|
|
|
|
|
|
|
|
|
2017-01-12 15:37:18 +01:00
|
|
|
# Don't retrieve and process some VMware attribute keys
|
|
|
|
# Default values permit to sanitize inventory meta and to improve a little bit
|
|
|
|
# performance by removing non-common group attributes.
|
|
|
|
#skip_keys = declaredalarmstate,disabledmethod,dynamicproperty,dynamictype,environmentbrowser,managedby,parent,childtype,resourceconfig
|
|
|
|
|
|
|
|
|
2016-05-31 02:41:48 +02:00
|
|
|
# Host alias for objects in the inventory. VMWare allows duplicate VM names
|
|
|
|
# so they can not be considered unique. Use this setting to alter the alias
|
2017-01-10 15:09:11 +01:00
|
|
|
# returned for the hosts. Any atributes for the guest can be used to build
|
|
|
|
# this alias. The default combines the config name and the config uuid and
|
2016-05-31 02:41:48 +02:00
|
|
|
# expects that the ansible_host will be set by the host_pattern.
|
|
|
|
#alias_pattern={{ config.name + '_' + config.uuid }}
|
|
|
|
|
|
|
|
|
|
|
|
# Host pattern is the value set for ansible_host and ansible_ssh_host, which
|
|
|
|
# needs to be a hostname or ipaddress the ansible controlhost can reach.
|
|
|
|
#host_pattern={{ guest.ipaddress }}
|
|
|
|
|
|
|
|
|
2017-01-10 15:09:11 +01:00
|
|
|
# Host filters are a comma separated list of jinja patterns to remove
|
2016-05-31 02:41:48 +02:00
|
|
|
# non-matching hosts from the final result.
|
|
|
|
# EXAMPLES:
|
|
|
|
# host_filters={{ config.guestid == 'rhel7_64Guest' }}
|
|
|
|
# host_filters={{ config.cpuhotremoveenabled != False }},{{ runtime.maxmemoryusage >= 512 }}
|
|
|
|
# host_filters={{ config.cpuhotremoveenabled != False }},{{ runtime.maxmemoryusage >= 512 }}
|
2017-11-21 05:32:18 +01:00
|
|
|
# host_filters={{ runtime.powerstate == "poweredOn" }}
|
|
|
|
# host_filters={{ guest.gueststate == "notRunning" }}
|
|
|
|
# The default value is powerstate of virtual machine equal to "poweredOn". (Changed in version 2.5)
|
|
|
|
# Runtime state does not require to have vmware tools installed as compared to "guest.gueststate"
|
|
|
|
#host_filters={{ runtime.powerstate == "poweredOn" }}
|
|
|
|
|
2016-05-31 02:41:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Groupby patterns enable the user to create groups via any possible jinja
|
|
|
|
# expression. The resulting value will the groupname and the host will be added
|
|
|
|
# to that group. Be careful to not make expressions that simply return True/False
|
|
|
|
# because those values will become the literal group name. The patterns can be
|
|
|
|
# comma delimited to create as many groups as necessary
|
|
|
|
#groupby_patterns={{ guest.guestid }},{{ 'templates' if config.template else 'guests'}}
|
2016-10-18 22:21:37 +02:00
|
|
|
|
2017-01-12 15:37:18 +01:00
|
|
|
# Group by custom fields will use VMware custom fields to generate hostgroups
|
|
|
|
# based on {{ custom_field_group_prefix }} + field_name + _ + field_value
|
|
|
|
# Set groupby_custom_field to True will enable this feature
|
|
|
|
# If custom field value is comma separated, multiple groups are created.
|
|
|
|
# Warning: This required max_object_level to be set to 2 or greater.
|
|
|
|
#groupby_custom_field = False
|
|
|
|
|
|
|
|
# You can customize prefix used by custom field hostgroups generation here.
|
|
|
|
# vmware_tag_ prefix is the default and consistent with ec2_tag_
|
2018-06-15 16:58:53 +02:00
|
|
|
#custom_field_group_prefix = vmware_tag_
|
2017-01-12 15:37:18 +01:00
|
|
|
|
2016-10-18 22:21:37 +02:00
|
|
|
# The script attempts to recurse into virtualmachine objects and serialize
|
|
|
|
# all available data. The serialization is comprehensive but slow. If the
|
|
|
|
# vcenter environment is large and the desired properties are known, create
|
|
|
|
# a 'properties' section in this config and make an arbitrary list of
|
2017-01-10 15:09:11 +01:00
|
|
|
# key=value settings where the value is a path to a specific property. If
|
2016-10-18 22:21:37 +02:00
|
|
|
# If this feature is enabled, be sure to fetch every property that is used
|
|
|
|
# in the jinja expressions defined above. For performance tuning, reduce
|
2017-01-10 15:09:11 +01:00
|
|
|
# the number of properties to the smallest amount possible and limit the
|
2016-10-18 22:21:37 +02:00
|
|
|
# use of properties that are not direct attributes of vim.VirtualMachine
|
|
|
|
#[properties]
|
|
|
|
#prop01=name
|
|
|
|
#prop02=config.cpuHotAddEnabled
|
|
|
|
#prop03=config.cpuHotRemoveEnabled
|
|
|
|
#prop04=config.instanceUuid
|
|
|
|
#prop05=config.hardware.numCPU
|
|
|
|
#prop06=config.template
|
|
|
|
#prop07=config.name
|
|
|
|
#prop08=guest.hostName
|
|
|
|
#prop09=guest.ipAddress
|
|
|
|
#prop10=guest.guestId
|
|
|
|
#prop11=guest.guestState
|
|
|
|
#prop12=runtime.maxMemoryUsage
|
2018-06-15 16:58:53 +02:00
|
|
|
# In order to populate `customValue` (virtual machine's custom attributes) inside hostvars,
|
|
|
|
# uncomment following property. Please see - https://github.com/ansible/ansible/issues/41395
|
|
|
|
#prop13=customValue
|