{# ansible/playbooks.html — the Playbooks tab (#5331): every playbook across its sources in one list, what each says it does and how it last ran; the whole row opens the playbook's page, where it is run. A source with no playbooks is one quiet line under the list. #} {% extends "base.html" %} {% from "_macros.html" import crumbs, page_header, status_badge, empty_state %} {% from "ansible/_tabs.html" import ansible_tabs %} {% block title %}Playbooks — Steward{% endblock %} {% block breadcrumb %}{{ crumbs([("Ansible", "/ansible/"), ("Playbooks", "")]) }}{% endblock %} {% block section_tabs %}{{ ansible_tabs("playbooks") }}{% endblock %} {% block content %} {% call page_header("Playbooks") %} {% if can_add %}New playbook{% endif %} {% endcall %} {% if not sources %}
{{ empty_state("No playbook sources are set up.", "Add one in Settings", "/settings/ansible/") }}
{% else %} {% set n_src = rows|map(attribute="source")|unique|list|length %} {% set n_bad = rows|selectattr("confirm")|list|length %}

{{- rows|length }} playbook{{ 's' if rows|length != 1 }}{% if n_src %} from {{ n_src }} source{{ 's' if n_src != 1 }}{% endif %} {%- if n_bad %} · {{ n_bad }} flagged destructive by {{ 'their authors' if n_bad > 1 else 'its author' }}{% endif -%}

{% if rows %}
{% for r in rows %} {% endfor %}
PlaybookSourceLast run
{% endif %} {% for s in empty_sources %}

{{ s.name }} ({{ s.path }}) has no playbooks yet. {%- if can_add and s.editable %} Write one{% endif %}

{% endfor %} {% endif %} {% endblock %}