Dirty way to get memory total from host

Hi all!

I am trying to write some logic to grab the current memory configuration of a host and use that information to choose template variables to build a configuration file. Has anyone attempted this? If so, what was the quick and dirty way that you grabbed memory totals.

Thanks!

I found the fact ansible_memtotal_mb.

What I ended up doing is define a value total based on memory total. I had to do this because I was getting an error trying to iterate on an int value.