CI run 8705 on 0c72892: the schedule page's no-inline-style guard caught
_playbook_vars.html (shared by the run and schedule forms), and the run
page's Run again assertion left out the link's class.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
54 lines
2.4 KiB
HTML
54 lines
2.4 KiB
HTML
{# Description + discovered variable fields for a selected playbook. Shared by
|
|
the playbook page's run form and the schedule form. Expects `variables`
|
|
and `description`. Rendered standalone by /ansible/playbook-vars.
|
|
Optional: `values` (dict var-name→saved value, prefills fields for edit
|
|
forms) and `schedule` (True in the schedule form — schedules can't prompt,
|
|
so secret vars are shown disabled and the confirm gate isn't `required`). #}
|
|
{% set _values = values|default({}) %}
|
|
{% set _schedule = schedule|default(false) %}
|
|
{% if description or category %}
|
|
<div class="pb-about">
|
|
{% if category %}<span class="pb-category">{{ category }}</span>{% endif %}
|
|
{{ description }}
|
|
</div>
|
|
{% endif %}
|
|
{% if confirm %}
|
|
<label class="pb-confirm">
|
|
<input type="checkbox" name="confirmed" {% if not _schedule %}required{% endif %}>
|
|
<span><strong>Confirm:</strong> this playbook is marked as making
|
|
significant or destructive changes. Tick to enable running it.</span>
|
|
</label>
|
|
{% endif %}
|
|
{% if variables %}
|
|
<div class="pb-vars-title">Playbook variables</div>
|
|
<p class="field-hint pb-vars-hint">
|
|
Leave a field blank to use the playbook/inventory default. Secret fields are never stored.
|
|
</p>
|
|
{% for v in variables %}
|
|
<div class="form-group">
|
|
<label>
|
|
{{ v.prompt or v.name }}
|
|
<span class="pb-var-name">
|
|
({{ v.name }}{% if v.required %}, required{% endif %}{% if v.secret %}, secret{% endif %})
|
|
</span>
|
|
</label>
|
|
{% if v.secret and _schedule %}
|
|
{# Scheduled runs can't prompt, so secret vars are dropped downstream — show
|
|
the field disabled rather than inviting silent data loss. #}
|
|
<input type="text" disabled class="input mono"
|
|
placeholder="secrets can't be scheduled — set via inventory / global creds">
|
|
{% else %}
|
|
{% if v.secret %}<input type="hidden" name="secret__{{ v.name }}" value="1">{% endif %}
|
|
<input type="{{ 'password' if v.secret else 'text' }}" class="input mono"
|
|
name="var__{{ v.name }}"
|
|
{% if not v.secret %}value="{{ _values.get(v.name, '') }}"{% endif %}
|
|
{% if v.required %}required{% endif %}
|
|
{% if v.secret %}autocomplete="new-password"{% endif %}
|
|
placeholder="{% if v.secret %}(hidden){% elif v.default not in (None, '') %}default: {{ v.default }}{% else %}no default{% endif %}">
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<p class="field-hint pb-vars-hint">No declared variables found in this playbook.</p>
|
|
{% endif %}
|