Solution: Ansible Language
Look at the solution to the previous exercise.
We'll cover the following...
We'll cover the following...
DATE: {{ ansible_date_time.date }}
vCPU: {{ ansible_processor_vcpus }}
RAM: {{ ansible_memtotal_mb }}
Created by Ansible {{ ansible_version.string }}Code for creating a resource usage text report
Explanation
For the
report.ymlplaybook file:Line 2: We write the play named
exercise.Line 3: We specify the
allhost for the target hosts of execution.Lines 4–5: We create a variable named
myfilewith the value"/usercode/report.txt"....