davegravy
davegravy

Reputation: 934

How to output host-specific variable along with hostname for all tasks in Ansible

Instead of the usual output which shows only status and hostname, how can I also output the value of a host-specific variable that is loaded from inventory.py under the _meta["hostvars"] key?

Looking for output something like:

TASK [Ping host]
********************************************
ok: [192.168.80.1] foo   
ok: [192.168.80.2] bar   
ok: [192.168.80.3] foo2

I want this to happen independent of OK/FAILURE/UNREACHABLE task status.

Upvotes: 1

Views: 45

Answers (1)

Vladimir Botka
Vladimir Botka

Reputation: 67959

There is no such plugin. You'll have to write one.

Upvotes: 1

Related Questions