This playbook can generate VMware VM inventory report.
Clone this repository and install ansible and the required python modules.
$ git clone https://github.com/sky-joker/ansible-vmware-vm-inventory-report-generator
$ cd ansible-vmware-vm-inventory-report-generator
$ pip install -r requirements.txt
Please change the following variables.
$ vi ansible-vmware-vm-inventory-generator.yml
---
- name: VMware VM Inventory Generator
hosts: localhost
gather_facts: no
vars:
hostname: vCenter IP # please change to ip or hostname for vCenter Server
username: administrator@vsphere.local # please change to vCenter Server login user name
password: password # please change to vCenter Server login password
export_type: html # please choices['html', 'csv']
tasks:
- name: Gather fact for all vm
(snip)
Run playbook using ansible-playbook command.
$ ansible-playbook ansible-vmware-vm-inventory-generator.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [VMware VM Inventory Generator] ********************************************************************************************************************************
TASK [Gather fact for all vm] ***************************************************************************************************************************************
ok: [localhost]
TASK [Gather facts for vm summary] **********************************************************************************************************************************
ok: [localhost] => (item=molecule01)
ok: [localhost] => (item=AD01)
ok: [localhost] => (item=awx)
(snip)
MIT
This playbook was created by sky-joker.