Simple Server Checks

Hi Guru’s,

I am currently evaluating Ansible and a quick win would be be to be able to use Ansible for checking pre-built servers against set criteria.
Some of this can be obtained from facts, but but how do I access these and check that say all file systems have > xMB free?

To summarise, any guidance or examples to perform the following would be greatly appreciated.

How do I check that a fact meets set criteria (eg RAM > xMB)
How do I run a Linux command or PowerShell command and check the output (does output contain string XYX or is value > x)

What are the best practices regarding the running of playbooks/roles and processing the output…
Do you try and use Ansible for all checking? OR should I run with -v and process the returned output using Linux scripts?

I don’t want to go down the wrongf route and want to keep the use of use of Ansible simple so its easy to develop/run/maintain.

Cheers.

You can add assert/fail tasks to your play that use the facts and
calculate the needed parameters.