here is my config
plugin: vmware_vm_inventorystrict: Falsehostname: {{ vcenter_host
}}.{{ domain_name }}username: {{ vcenter_user }}password: {{
vcenter_password }}validate_certs: Falsewith_tags:
Trueansible_python_interpreter: /tmp/vminv_virtualenv/bin/python
I run
python $(which ansible-inventory) --list -i ./{{ vcenter_host }}.{{
inventory_yaml }} --vault-password-file={{ password_file }} -y >
../{{ inventory_directory }}/hosts.{{ vcenter_host
}}.ymlansible-inventory -i <config.yml> -y
here is what I get:
all: children: Application: {} CFG: {} DEMO: {} DEV:
hosts: vmalterxycp01: ansible_host: 10.226.0.56
config.cpuHotAddEnabled: false config.cpuHotRemoveEnabled:
false config.hardware.numCPU: 4 config.instanceUuid:
5026aa79-6b5e-8310-46be-850498deb8a4 config.name:
VMALTERXYCP01 config.template: false guest.guestId:
windows8Server64Guest guest.guestState: running
guest.hostName: VMALTERXYCP01.regence.com guest.ipAddress:
10.226.0.56 name: VMALTERXYCP01
runtime.maxMemoryUsage: 16384 vmalterxywp01:
ansible_host: 10.226.0.55 config.cpuHotAddEnabled: false
config.cpuHotRemoveEnabled: false config.hardware.numCPU:
4 config.instanceUuid: 50265e22-8599-48cf-c6ed-3f060416f733
config.name: VMALTERXYWP01 config.template: false
guest.guestId: windows8Server64Guest guest.guestState:
running guest.hostName: VMALTERXYWP01.regence.com
guest.ipAddress: 10.226.0.55 name: VMALTERXYWP01
runtime.maxMemoryUsage: 16384 vmhvwarsd01:
ansible_host: 10.226.0.77 config.cpuHotAddEnabled: true
config.cpuHotRemoveEnabled: false config.hardware.numCPU:
4 config.instanceUuid: 50269812-e4e7-2fb7-6026-5aa7ba1766ae
config.name: VMHVWARSD01 config.template: false
guest.guestId: windows9Server64Guest guest.guestState:
running guest.hostName: VMHVWARSD01.regence.com
guest.ipAddress: 10.226.0.77 name: VMHVWARSD01
runtime.maxMemoryUsage: 12288
....
poweredOff:
hosts: 20100608p_ws2k8ex64sp2:
config.cpuHotAddEnabled: false config.cpuHotRemoveEnabled:
false config.hardware.numCPU: 1 config.instanceUuid:
5014d83b-9acb-1c2a-b830-1e78080ce71c config.name:
20100608p_WS2K8Ex64SP2 config.template: false
guest.guestId: null guest.guestState: notRunning
guest.hostName: null guest.ipAddress: null name:
20100608p_WS2K8Ex64SP2 runtime.maxMemoryUsage: null
20150928-w2k12r2: config.cpuHotAddEnabled: true
config.cpuHotRemoveEnabled: false config.hardware.numCPU: 2
config.instanceUuid: 5288e531-2433-c90a-f922-d5b956ebb018
config.name: 20150928-w2k12r2 config.template: false
guest.guestId: null guest.guestState: notRunning
guest.hostName: WIN-PJKUVJ4HV62 guest.ipAddress: null
name: 20150928-w2k12r2 runtime.maxMemoryUsage: null
20161101_WIN_2016_standard: config.cpuHotAddEnabled: true
config.cpuHotRemoveEnabled: false
config.hardware.numCPU: 2 config.instanceUuid:
52b10d2a-ee77-1e09-9665-3dce8e390526 config.name:
20161101_WIN_2016_Standard config.template: false
guest.guestId: null guest.guestState: notRunning
guest.hostName: WIN-EN97QOJK0VD guest.ipAddress: null
name: 20161101_WIN_2016_Standard runtime.maxMemoryUsage:
null ansible-20150928-w2k12r2:
On Wed, Jun 24, 2020 at 9:42 AM Abhijeet Kasurde <[email protected]>
wrote:
> Could you please share your inventory plugin config? What you want to
> achieve with small example?
>
> On Wed, Jun 24, 2020 at 9:58 PM Todd Schaal <[email protected]> wrote:
>
>> I have the vmware_vm_inventory plugin working. My issue is that it
>> returns everything, including powered-off vms. I can filter them out when
>> I run my playbooks, but I'd prefer they not be in my inventory in the
>> first place. Is there an easy way to accomplish this?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/a4cde871-5ace-4fe9-b966-d2db66e44709o%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/a4cde871-5ace-4fe9-b966-d2db66e44709o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> Thanks,
> Abhijeet Kasurde
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/_wNmnAjMLiQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAFwWkHpzh7msMPPKoAdwk15x4rw24s4_GXzVaqZARQLkSxdxHw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAFwWkHpzh7msMPPKoAdwk15x4rw24s4_GXzVaqZARQLkSxdxHw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CADdWuXXT8eAmHhoP%3DQsiv7SKbVFD9Z27peRRsV%3DNyt4eSzbzDA%40mail.gmail.com.