diff options
author | Abhijeet Kasurde <akasurde@redhat.com> | 2019-01-11 21:33:14 +0530 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2019-01-14 12:35:21 -0800 |
commit | f201aa89483e374cd778dfe401a5c0c5d0003bba (patch) | |
tree | 3cb6b556e61156759b19ff9df70478b6f45110a9 /docs | |
parent | d20040296bc7b51187f2cb8612ccd6f63f61a706 (diff) | |
download | ansible-f201aa89483e374cd778dfe401a5c0c5d0003bba.tar.gz |
[Backport 2.7] VMware: Fix vmware_vm_inventory
* Added documentation around using vmware dynamic inventory plugin
* Fixed bug for populating host_ip in hostvars for given inventory host
* VMware: Add properties in vmware_vm_inventory
Fixes: #50249
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit af914695e6eb38ff7c1d4585b9218e9b7915756f)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/docsite/rst/vmware/index.rst | 1 | ||||
-rw-r--r-- | docs/docsite/rst/vmware/vmware_inventory.rst | 51 |
2 files changed, 52 insertions, 0 deletions
diff --git a/docs/docsite/rst/vmware/index.rst b/docs/docsite/rst/vmware/index.rst index 6bfa290333..8275f8197e 100644 --- a/docs/docsite/rst/vmware/index.rst +++ b/docs/docsite/rst/vmware/index.rst @@ -18,6 +18,7 @@ To get started, please select one of the following topics. vmware_concepts vmware_requirements vmware_getting_started + vmware_inventory vmware_scenarios vmware_module_reference vmware_troubleshooting diff --git a/docs/docsite/rst/vmware/vmware_inventory.rst b/docs/docsite/rst/vmware/vmware_inventory.rst new file mode 100644 index 0000000000..629098767d --- /dev/null +++ b/docs/docsite/rst/vmware/vmware_inventory.rst @@ -0,0 +1,51 @@ +.. _vmware_ansible_inventory: + +************************************* +Using VMware dynamic inventory plugin +************************************* + +.. contents:: Topics + +VMware Dynamic Inventory Plugin +=============================== + + +The best way to interact with your hosts is to use the VMware dynamic inventory plugin, which dynamically queries VMware APIs and +tells Ansible what nodes can be managed. + +To be able to use this VMware dynamic inventory plugin, you need to enable it first by specifying the following in the ``ansible.cfg`` file: + +.. code-block:: ini + + [inventory] + enable_plugins = vmware_vm_inventory + +Then, create a file that ends in ``.vmware.yml`` or ``.vmware.yaml`` in your working directory. + +The ``vmware_vm_inventory`` script takes in the same authentication information as any VMware module. + +Here's an example of a valid inventory file: + +.. code-block:: yaml + + plugin: vmware_vm_inventory + strict: False + hostname: 10.65.223.31 + username: administrator@vsphere.local + password: Esxi@123$% + validate_certs: False + with_tags: True + + +Executing ``ansible-inventory --list -i <filename>.vmware.yml`` will create a list of VMware instances that are ready to be configured using Ansible. + + +.. seealso:: + + `pyVmomi <https://github.com/vmware/pyvmomi>`_ + The GitHub Page of pyVmomi + `pyVmomi Issue Tracker <https://github.com/vmware/pyvmomi/issues>`_ + The issue tracker for the pyVmomi project + :ref:`working_with_playbooks` + An introduction to playbooks + |