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
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: tony
<localhost> EXEC /bin/sh -c 'echo ~tony && sleep 0'
<localhost> 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
<localhost> PUT /home/tony/.ansible/tmp/ansible-local-13810s8NNqR/tmpZCfPWw
TO
/home/tony/.ansible/tmp/ansible-tmp-1590380567.97-36211623708055/AnsiballZ_vmware_guest_info.py
<localhost> 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'
<localhost> EXEC /bin/sh -c '/usr/bin/python
/home/tony/.ansible/tmp/ansible-tmp-1590380567.97-36211623708055/AnsiballZ_vmware_guest_info.py
&& sleep 0'
<localhost> 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": "[email protected]",
            "uuid": null,
            "validate_certs": false
        }
    },
    "item": "dr-reb"
}
<localhost> EXEC /bin/sh -c 'echo ~tony && sleep 0'
<localhost> 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
<localhost> PUT /home/tony/.ansible/tmp/ansible-local-13810s8NNqR/tmpp4DUr9
TO
/home/tony/.ansible/tmp/ansible-tmp-1590380569.92-7854716787443/AnsiballZ_vmware_guest_info.py
<localhost> 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'
<localhost> EXEC /bin/sh -c '/usr/bin/python
/home/tony/.ansible/tmp/ansible-tmp-1590380569.92-7854716787443/AnsiballZ_vmware_guest_info.py
&& sleep 0'
<localhost> 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": "[email protected]",
            "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?

On Sun, May 24, 2020 at 4:29 PM James Cassell <[email protected]>
wrote:

>
> > On Sun, May 24, 2020 at 4:08 PM James Cassell
> > <[email protected]> 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: [email protected]
> > >  > 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/b61aadf7-e8a3-45b2-b0ea-af40408cd781%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CALmkhkpyTCrwC-63LMhodF7e_Tj9CFxOMUQeXb_JF57PrbFA2w%40mail.gmail.com.

Reply via email to