- Learning Ansible 2.7(Third Edition)
- Fabio Alessandro Locati
- 75字
- 2021-06-24 15:08:45
Variables
As we have seen, we can print variable content simply by using the {{ VARIABLE_NAME }} syntax. If we want to print just an element of an array, we can use {{ ARRAY_NAME['KEY'] }}, and if we want to print a property of an object, we can use {{ OBJECT_NAME.PROPERTY_NAME }}.
So, we can improve our previous static page in the following way:
<html> <body> <h1>Hello World!</h1> <p>This page was created on {{ ansible_date_time.date }}.</p> </body> </html>