Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible - print gathered facts for debugging purposes [duplicate]

Tags:

Is there exists some way to print on console gathered facts ?
I mean gatering facts using setup module. I would like to print gathered facts. Is it possible ? If it is possible can someone show example?

like image 365
newbie Avatar asked Apr 05 '18 16:04

newbie


People also ask

How do I print multiple variables in ansible?

An answer on StackOverflow suggests using - debug: var=vars or - debug: var=hostvars to print out all the variables used by an Ansible playbook.

What does ansible gather facts do?

Ansible facts are data gathered about target nodes (host nodes to be configured) and returned back to controller nodes. Ansible facts are stored in JSON format and are used to make important decisions about tasks based on their statistics.


Video Answer


1 Answers

Use setup module as ad-hoc command:

ansible myhost -m setup 
like image 175
Konstantin Suvorov Avatar answered Oct 02 '22 09:10

Konstantin Suvorov