{% include "head.html" %} {% macro display_result(result, hdr) %} {% if result is mapping %} {% if 'item' in result %} <{{ hdr }}>Item
{{ result.item |to_nice_json |safe }}
{% endif %} {% for attr in result.keys()|sort if attr not in ['item', 'changed', 'stdout_lines'] %} {% if result[attr]|default(False) %} <{{ hdr }}>{{ attr|title }} {% if result[attr] is string %}
{{ result[attr] }}
{% elif result[attr] is mapping or result[attr] is iterable%}
{{ result[attr] |to_nice_json |safe }}
{% else %}
{{ result |to_nice_json |safe }}
{% endif %} {% endif %} {% endfor %} {% else %}
{{ result |to_nice_json |safe }}
{% endif %} {% endmacro %}

Task: {{ task_result.task.name }}

Host: {{ task_result.host.name }}

Time: {{ task_result.time_start |datefmt }}

Ansible version: {{ task_result.task.playbook.ansible_version }}

{% set result = task_result.result|from_json %} {% if 'results' in result %} {% for item in result.results %}

Result {{loop.index}}

{{ display_result(item, 'h3') }} {% endfor %} {% else %} {{ display_result(result, 'h2') }} {% endif %}