{# ansible/playbook.html — one playbook's page (#5331): what it says it does and how it last ran, the form that runs it (operators), the schedules that use it, its recent runs, then the playbook itself, folded. #} {% extends "base.html" %} {% from "_macros.html" import crumbs, page_header, status_badge %} {% from "ansible/_tabs.html" import ansible_tabs %} {% from "ansible/_macros.html" import interval_words %} {% block title %}{{ playbook_path }} — Steward{% endblock %} {% block breadcrumb %}{{ crumbs([("Ansible", "/ansible/"), ("Playbooks", "/ansible/playbooks"), (playbook_path, "")]) }}{% endblock %} {% block section_tabs %}{{ ansible_tabs("playbooks") }}{% endblock %} {% block content %} {% set can_run = session.user_role in ('operator', 'admin') %} {% call page_header(playbook_path) %} {% if editable and session.user_role == 'admin' %} Edit
{{ csrf_field() }}
{% endif %} {% endcall %}

{%- if category %}{{ category }} {% endif -%} {{ description or "It says nothing about what it does." }} {%- if confirm %} · flagged destructive by its author: a real run asks you to confirm{% endif %} · from {{ source_name }} {%- if runs %} · last ran {{ runs[0].run.started_at|ago }} {{ status_badge(runs[0].run.status) }}{% else %} · never run{% endif -%}

{% if can_run %}

Run it

{% include "ansible/_run_form.html" %}
{% endif %}

Schedules {%- if schedules %} {{ schedules|length }}{% endif %} {%- if can_run %} Schedule it →{% endif %}

{% if schedules %} {% for row in schedules %}{% set s = row.s %} {% endfor %}
{{ s.name }} on {{ row.scope_label }} · {{ interval_words(s.interval_seconds) }} {% if not s.enabled %}paused {%- elif row.next and row.next.at %}next {{ row.next.at|ago }}{% else %}due now{% endif %}
{% else %}

No schedule runs it.

{% endif %}

Recent runs {%- if runs %} All its runs →{% endif %}

{% if runs %} {% with compact=true, more_url=none %}{% include "ansible/_runs_page.html" %}{% endwith %}
RunResultStarted byStartedTook
{% else %}

It has not been run yet.

{% endif %}
The playbook
{{ contents }}
{% endblock %}