Print ansible fact from remote nodes

Hi.

I guess I am missing something obvious, but how can I print some ansible fact from all remote nodes. For example I want to get $ansible_memtotal_mb from all nodes:

tasks:

  • name: get mem fact

action: command echo $ansible_memtotal_mb

But when I run this playbook, nothing happens, I mean Its not printing anything…

Edgars

Add -v to your command line to ansible-playbook or run the setup module with

/usr/bin/ansible all -m setup