Collecting system information
In this section, you will extract the required information from ansible_facts
and generate HTML reports inside the web server that you created in the previous section.
ansible_facts
contains a lot of information about nested dictionaries and lists. Search and go through the content and find the important information you need for your report.
To see the content of ansible_facts
, execute the following ad hoc command:
Figure 3.20 – Ansible facts output after using an ad hoc command
Using the less
or more
commands after the pipe (|
) symbol will keep the output on top without you having to scroll to the bottom. It is possible to scroll down or up using the arrow keys or find the text by searching for it (/
+ <text>
).
Find sample ansible_facts
details for a Linux machine at https://github.com/PacktPublishing/Ansible-for-Real-life-Automation/tree/main/Chapter-03/node1-ansible-facts.
Follow these steps to use some...