Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available
> > You have to use register module and get that output from debug module. > > -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CADBoQTr%3D2B-T7PrqNBE_3vHZUtoMF3PYefuB%3Dax-%2B3J74WJ1rQ%40mail.gmail.com.
Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available
what line am i missing to output the information? without using - On Sun, May 24, 2020 at 11:17 PM David Foley wrote: > 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 > > -- > 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 ansible-project+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/cf0ed58a-48ea-4ecb-b9bc-4b36790aae06%40googlegroups.com > . > -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CALmkhkq-%2BBMDLO_-urB82wNKC-7mSPnvVLmWqUX9%2BsmNgbCPCg%40mail.gmail.com.
Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available
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 -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cf0ed58a-48ea-4ecb-b9bc-4b36790aae06%40googlegroups.com.
Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available
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/
Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available
On Sun, 24 May 2020 16:13:56 -0700 Tony Wong wrote: > [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 shell> ansible-inventory -vvv --graph -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20200525013231.2f692512%40gmail.com. pgp9cBb3EWzsO.pgp Description: OpenPGP digital signature
Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available
> On Sun, May 24, 2020 at 4:08 PM James Cassell > wrote: > > > > On Sun, May 24, 2020, at 6:56 PM, Tony Wong wrote: > > > --- > > > - name: get info vm > > > hosts: localhost > > > connection: local > > > gather_facts: false > > > vars: > > > vm_list: > > > - dr-reb > > > - dr-wac > > > tasks: > > > - name: get info about the virtual machine > > > vmware_guest_info: > > > hostname: vcenter > > > username: administrator@vsphere.local > > > password: Password123@ > > > datacenter: RW-VA > > > validate_certs: False > > > name: "{{ item }}" > > > schema: "vsphere" > > > properties: ["config.hardware.memoryMB", "config.hardware.numCPU", > > > "guest.disk", "overallStatus"] > > > delegate_to: localhost > > > register: vm_info > > > with_items: "{{ vm_list }}" > > > - debug: > > > msg: "{{ vm_list }}" > > > > > > > > > tony@ubuntu:~/ansiblework$ > > > tony@ubuntu:~/ansiblework$ > > > tony@ubuntu:~/ansiblework$ > > > tony@ubuntu:~/ansiblework$ > > > tony@ubuntu:~/ansiblework$ ansible-playbook vmware_tools.yml > > > > > > > > > > > > > > > > > > why is it when i run this pb > > > > > > I get nothing but this > > > > > > [WARNING]: provided hosts list is empty, only localhost is available. > > > Note that the implicit localhost does not match 'all' > > > > > > [WARNING]: Found variable using reserved name: tasks > > > > > > > Delete 2 spaces from the tasks line. > > > > V/r, > > James Cassell > > On Sun, May 24, 2020, at 7:13 PM, Tony Wong wrote: > 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 > Run with -vvv to see all the details of each task. V/r, James Cassell -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b61aadf7-e8a3-45b2-b0ea-af40408cd781%40www.fastmail.com.
Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available
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=2changed=0unreachable=0failed=0 skipped=0rescued=0ignored=0 On Sun, May 24, 2020 at 4:08 PM James Cassell wrote: > > On Sun, May 24, 2020, at 6:56 PM, Tony Wong wrote: > > --- > > - name: get info vm > > hosts: localhost > > connection: local > > gather_facts: false > > vars: > > vm_list: > > - dr-reb > > - dr-wac > > tasks: > > - name: get info about the virtual machine > > vmware_guest_info: > > hostname: vcenter > > username: administrator@vsphere.local > > password: Password123@ > > datacenter: RW-VA > > validate_certs: False > > name: "{{ item }}" > > schema: "vsphere" > > properties: ["config.hardware.memoryMB", "config.hardware.numCPU", > > "guest.disk", "overallStatus"] > > delegate_to: localhost > > register: vm_info > > with_items: "{{ vm_list }}" > > - debug: > > msg: "{{ vm_list }}" > > > > > > tony@ubuntu:~/ansiblework$ > > tony@ubuntu:~/ansiblework$ > > tony@ubuntu:~/ansiblework$ > > tony@ubuntu:~/ansiblework$ > > tony@ubuntu:~/ansiblework$ ansible-playbook vmware_tools.yml > > > > > > > > > > > > why is it when i run this pb > > > > I get nothing but this > > > > [WARNING]: provided hosts list is empty, only localhost is available. > > Note that the implicit localhost does not match 'all' > > > > [WARNING]: Found variable using reserved name: tasks > > > > Delete 2 spaces from the tasks line. > > V/r, > James Cassell > > -- > 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 ansible-project+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/e3016f38-6094-4de7-9c52-ececd1b3ac05%40www.fastmail.com > . > -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CALmkhkrYKULujhDcjs7ZzRcL1mjgw2d_zqHHMpvqfw36NA6oxw%40mail.gmail.com.
Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available
On Sun, May 24, 2020, at 6:56 PM, Tony Wong wrote: > --- > - name: get info vm > hosts: localhost > connection: local > gather_facts: false > vars: > vm_list: > - dr-reb > - dr-wac > tasks: > - name: get info about the virtual machine > vmware_guest_info: > hostname: vcenter > username: administrator@vsphere.local > password: Password123@ > datacenter: RW-VA > validate_certs: False > name: "{{ item }}" > schema: "vsphere" > properties: ["config.hardware.memoryMB", "config.hardware.numCPU", > "guest.disk", "overallStatus"] > delegate_to: localhost > register: vm_info > with_items: "{{ vm_list }}" > - debug: > msg: "{{ vm_list }}" > > > tony@ubuntu:~/ansiblework$ > tony@ubuntu:~/ansiblework$ > tony@ubuntu:~/ansiblework$ > tony@ubuntu:~/ansiblework$ > tony@ubuntu:~/ansiblework$ ansible-playbook vmware_tools.yml > > > > > > why is it when i run this pb > > I get nothing but this > > [WARNING]: provided hosts list is empty, only localhost is available. > Note that the implicit localhost does not match 'all' > > [WARNING]: Found variable using reserved name: tasks > Delete 2 spaces from the tasks line. V/r, James Cassell -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e3016f38-6094-4de7-9c52-ececd1b3ac05%40www.fastmail.com.
Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available
You need a group as the second argument. try ansible -i hosts vm -m ping On 22 March 2016 at 14:33, Leroy Walker Jrwrote: > I could really use some help on this issue. I have a hosts file with one > server. > the hosts looks like > > [vm] > 172.20.20.106 > > when i run the host command, i get: > > ansible -i hosts --list-hosts all > hosts (1): > 172.20.20.106 > > but when i run a simple ping command > ansible hosts -m ping > [WARNING]: provided hosts list is empty, only localhost is available > > I get the following > > I have not idea whats wrong! > > -- > 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 ansible-project+unsubscr...@googlegroups.com. > To post to this group, send email to ansible-project@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/3c0373b0-2259-4023-9eb5-c9c02735ba0a%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAK5eLPR4nro-17p9DCzXA29XaT%2Bsu0-RTRCiZvHsAy%3DCPP8-%2BA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.