I am running a simple Ansible ad-hoc command across all hosts in inventory and I want Ansible to also show the time it took to return output from each host. I can see the time in log, but I want to have it as stdout
.
I tried adding callback_whitelist = profile_tasks
in ansible.cfg
but that did not help.
For example, Ansible command
[demo@demoserver ~]$ ansible all -m shell -a 'hostname -f'
output shows
worker0 | CHANGED | rc=0 >>
iworker0.unix.demo.com
worker2 | CHANGED | rc=0 >>
iworker2.unix.demo.com
worker1 | CHANGED | rc=0 >>
iworker1.unix.demo.com
worker3 | CHANGED | rc=0 >>
iworker3.unix.demo.com
and log shows
2020-01-30 15:46:27,924 p=22811 u=demo | worker0 | CHANGED | rc=0 >>
iworker0.unix.demo.com
2020-01-30 15:46:27,955 p=22811 u=demo | worker2 | CHANGED | rc=0 >>
iworker2.unix.demo.com
2020-01-30 15:46:27,960 p=22811 u=demo | worker1 | CHANGED | rc=0 >>
iworker1.unix.demo.com
2020-01-30 15:46:27,975 p=22811 u=demo | worker3 | CHANGED | rc=0 >>
iworker3.unix.demo.com
So, I want the time from log to appear as stdout
as well. Is that possible?
[demo@demoserver ~]$ ansible --version
ansible 2.7.12
config file = /home/demo/ansible.cfg
configured module search path = [u'/home/demo/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Jun 11 2019, 14:33:56) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]