Ansible fact is a way for tools to get data and complete information about a host and store them in the variables for their easy access. This information is stored in predefined variables that are available for use in the playbook. To generate the facts and simple techniques the setup module is as-

$ Ansible- m setup hostname

As soon as the statement gets executed it will print out a list of a dictionary of the facts which are available for a particular host. This is the way to access the list of available Ansible_variables. These facts can be seen as-

$ Ansible all- m setup

If a user wants to extract any particular part of the available information then the "set up" model can be used where an option is available to filter out the output and the facts which are required can behold.

Suggest An Answer

No suggestions Available!