Welcome to Jinja2 Example
This is a simple example of using Jinja2 templates.
Current Date and Time
{{ ansible_date_time.date }}
{% if ansible_date_time.time %}
{{ ansible_date_time.time }}
{% else %}
Time information is not available.
{% endif %}
System Information
- Hostname: {{ ansible_hostname }}
- OS: {{ ansible_distribution }} {{ ansible_distribution_version }}
- Architecture: {{ ansible_architecture }}
Network Interfaces
{% for interface in ansible_interfaces %}
- {{ interface }}: {{ ansible_facts[interface].ipv4.address }}
{% endfor %}
Available Packages
{% for package in ansible_pkg_mgr.packages %}
- {{ package.name }} - {{ package.version }}
{% endfor %}