# \[WARNING\]: provided hosts list is empty, only localhost is available

**URL:** <https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018>\
**Category:** Ansible Project\
**Created:** [May 24, 2020, 10:56pm UTC](https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018 "2020-05-24T22:56:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [May 24, 2020, 10:56pm UTC](https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018/1 "2020-05-24T22:56:49Z")

</div>



---

<div class="post-metadata">

**Author:** ![cassell](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cassell](https://forum.ansible.com/u/cassell)\
**Post date:** [May 24, 2020, 11:08pm UTC](https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018/2 "2020-05-24T23:08:08Z")

</div>

Delete 2 spaces from the tasks line.

V/r,  
James Cassell

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [May 24, 2020, 11:13pm UTC](https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018/3 "2020-05-24T23:13:56Z")

</div>

Thanks!

but I dont see any output running it

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’

PLAY [get info vm] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [get info about the virtual machine] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost → localhost] =\> (item=dr-reb)  
ok: [localhost → localhost] =\> (item=dr-wac)

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> {  
“msg”: [  
“dr-reb”,  
“dr-wac”  
]  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

---

<div class="post-metadata">

**Author:** ![cassell](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cassell](https://forum.ansible.com/u/cassell)\
**Post date:** [May 24, 2020, 11:29pm UTC](https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018/4 "2020-05-24T23:29:12Z")

</div>

Run with -vvv to see all the details of each task.

V/r,  
James Cassell

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [May 24, 2020, 11:32pm UTC](https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018/5 "2020-05-24T23:32:31Z")

</div>

> [WARNING]: provided hosts list is empty, only localhost is available. Note  
> that the implicit localhost does not match 'all'

Run the command below a see what's going on

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [May 25, 2020, 4:26am UTC](https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018/6 "2020-05-25T04:26:49Z")

</div>

tony@ubuntu:~/ansiblework$ ansible-playbook vmware\_tools.yml -vvv  
ansible-playbook 2.9.0  
config file = /home/tony/ansiblework/ansible.cfg  
configured module search path = [u’/home/tony/ansiblework/library’]  
ansible python module location = /home/tony/.local/lib/python2.7/site-packages/ansible  
executable location = /home/tony/.local/bin/ansible-playbook  
python version = 2.7.17 (default, Apr 15 2020, 17:20:14) [GCC 7.5.0]  
Using /home/tony/ansiblework/ansible.cfg as config file  
host\_list declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
script declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
auto declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
Parsed /etc/ansible/hosts inventory source with ini plugin  
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’

PLAYBOOK: vmware\_tools.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
1 plays in vmware\_tools.yml

PLAY [get info vm] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
META: ran handlers

TASK [get info about the virtual machine] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/tony/ansiblework/vmware\_tools.yml:11  
 ESTABLISH LOCAL CONNECTION FOR USER: tony  
 EXEC /bin/sh -c ‘echo ~tony && sleep 0’  
 EXEC /bin/sh -c ‘( umask 77 && mkdir -p “`echo /home/tony/.ansible/tmp/ansible-tmp-1590380567.97-36211623708055`” && echo ansible-tmp-1590380567.97-36211623708055=“`echo /home/tony/.ansible/tmp/ansible-tmp-1590380567.97-36211623708055`” ) && sleep 0’  
Using module file /home/tony/.local/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware\_guest\_info.py  
 PUT /home/tony/.ansible/tmp/ansible-local-13810s8NNqR/tmpZCfPWw TO /home/tony/.ansible/tmp/ansible-tmp-1590380567.97-36211623708055/AnsiballZ\_vmware\_guest\_info.py  
 EXEC /bin/sh -c ‘chmod u+x /home/tony/.ansible/tmp/ansible-tmp-1590380567.97-36211623708055/ /home/tony/.ansible/tmp/ansible-tmp-1590380567.97-36211623708055/AnsiballZ\_vmware\_guest\_info.py && sleep 0’  
 EXEC /bin/sh -c ‘/usr/bin/python /home/tony/.ansible/tmp/ansible-tmp-1590380567.97-36211623708055/AnsiballZ\_vmware\_guest\_info.py && sleep 0’  
 EXEC /bin/sh -c ‘rm -f -r /home/tony/.ansible/tmp/ansible-tmp-1590380567.97-36211623708055/ \> /dev/null 2\>&1 && sleep 0’  
ok: [localhost → localhost] =\> (item=dr-reb) =\> {  
“ansible\_loop\_var”: “item”,  
“changed”: false,  
“instance”: {  
“config”: {  
“hardware”: {  
“memoryMB”: 8192,  
“numCPU”: 4  
}  
},  
“guest”: {  
“disk”: [  
{  
“\_vimtype”: “vim.vm.GuestInfo.DiskInfo”,  
“capacity”: 75159826432,  
“diskPath”: “C:\”,  
“freeSpace”: 12846444544  
},  
{  
“\_vimtype”: “vim.vm.GuestInfo.DiskInfo”,  
“capacity”: 32209104896,  
“diskPath”: “D:\”,  
“freeSpace”: 8619995136  
}  
]  
},  
“overallStatus”: “green”  
},  
“invocation”: {  
“module\_args”: {  
“datacenter”: “RW-VA”,  
“folder”: null,  
“hostname”: “vasvw-vcsa.”,  
“moid”: null,  
“name”: “dr-reb”,  
“name\_match”: “first”,  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“port”: 443,  
“properties”: [  
“config.hardware.memoryMB”,  
“config.hardware.numCPU”,  
“guest.disk”,  
“overallStatus”  
],  
“proxy\_host”: null,  
“proxy\_port”: null,  
“schema”: “vsphere”,  
“tags”: false,  
“use\_instance\_uuid”: false,  
“username”: “administrator@vsphere.local”,  
“uuid”: null,  
“validate\_certs”: false  
}  
},  
“item”: “dr-reb”  
}  
 EXEC /bin/sh -c ‘echo ~tony && sleep 0’  
 EXEC /bin/sh -c ‘( umask 77 && mkdir -p “`echo /home/tony/.ansible/tmp/ansible-tmp-1590380569.92-7854716787443`” && echo ansible-tmp-1590380569.92-7854716787443=“`echo /home/tony/.ansible/tmp/ansible-tmp-1590380569.92-7854716787443`” ) && sleep 0’  
Using module file /home/tony/.local/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware\_guest\_info.py  
 PUT /home/tony/.ansible/tmp/ansible-local-13810s8NNqR/tmpp4DUr9 TO /home/tony/.ansible/tmp/ansible-tmp-1590380569.92-7854716787443/AnsiballZ\_vmware\_guest\_info.py  
 EXEC /bin/sh -c ‘chmod u+x /home/tony/.ansible/tmp/ansible-tmp-1590380569.92-7854716787443/ /home/tony/.ansible/tmp/ansible-tmp-1590380569.92-7854716787443/AnsiballZ\_vmware\_guest\_info.py && sleep 0’  
 EXEC /bin/sh -c ‘/usr/bin/python /home/tony/.ansible/tmp/ansible-tmp-1590380569.92-7854716787443/AnsiballZ\_vmware\_guest\_info.py && sleep 0’  
 EXEC /bin/sh -c ‘rm -f -r /home/tony/.ansible/tmp/ansible-tmp-1590380569.92-7854716787443/ \> /dev/null 2\>&1 && sleep 0’  
ok: [localhost → localhost] =\> (item=dr-wac) =\> {  
“ansible\_loop\_var”: “item”,  
“changed”: false,  
“instance”: {  
“config”: {  
“hardware”: {  
“memoryMB”: 4096,  
“numCPU”: 2  
}  
},  
“guest”: {  
“disk”: [  
{  
“\_vimtype”: “vim.vm.GuestInfo.DiskInfo”,  
“capacity”: 42946523136,  
“diskPath”: “D:\”,  
“freeSpace”: 34454917120  
},  
{  
“\_vimtype”: “vim.vm.GuestInfo.DiskInfo”,  
“capacity”: 107266174976,  
“diskPath”: “C:\”,  
“freeSpace”: 20929310720  
}  
]  
},  
“overallStatus”: “green”  
},  
“invocation”: {  
“module\_args”: {  
“datacenter”: “RW-VA”,  
“folder”: null,  
“hostname”: “vasvw-vcsa.”,  
“moid”: null,  
“name”: “dr-wac”,  
“name\_match”: “first”,  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“port”: 443,  
“properties”: [  
“config.hardware.memoryMB”,  
“config.hardware.numCPU”,  
“guest.disk”,  
“overallStatus”  
],  
“proxy\_host”: null,  
“proxy\_port”: null,  
“schema”: “vsphere”,  
“tags”: false,  
“use\_instance\_uuid”: false,  
“username”: “administrator@vsphere.local”,  
“uuid”: null,  
“validate\_certs”: false  
}  
},  
“item”: “dr-wac”  
}

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/tony/ansiblework/vmware\_tools.yml:24  
ok: [localhost] =\> {  
“msg”: [  
“dr-reb”,  
“dr-wac”  
]  
}  
META: ran handlers  
META: ran handlers

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

Why do i need to run it wiht -vvv?

should my playbook show me the output?

---

<div class="post-metadata">

**Author:** ![David\_Foley](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@David\_Foley](https://forum.ansible.com/u/David_Foley)\
**Post date:** [May 25, 2020, 6:16am UTC](https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018/7 "2020-05-25T06:16:54Z")

</div>

It's outputting your items list, as you have msg on the list if you are looking to put the info you need to use a register then either var or message that register

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [May 25, 2020, 1:03pm UTC](https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018/8 "2020-05-25T13:03:45Z")

</div>

what line am i missing to output the information? without using -vvvv

---

<div class="post-metadata">

**Author:** ![Tej-Singh-Rana](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@Tej-Singh-Rana](https://forum.ansible.com/u/Tej-Singh-Rana)\
**Post date:** [May 25, 2020, 1:12pm UTC](https://forum.ansible.com/t/warning-provided-hosts-list-is-empty-only-localhost-is-available/33018/9 "2020-05-25T13:12:02Z")

</div>

> You have to use register module and get that output from debug module.
