{% extends "base.html" %} {% from "_macros.html" import crumbs, status_badge %} {% block title %}Agent fleet — Steward{% endblock %} {% block breadcrumb %}{{ crumbs([("Hosts", "/hosts/"), ("Agent fleet", "")]) }}{% endblock %} {% block content %}

Agent fleet

Bulk agent operations across your inventory. For a single host, use its host page: provisioning, a manual install command and metrics live there. New hosts are added with Add host.

{% if new_token %}

New token — copy this install command now

This is the only time the raw token is shown. Rotate if you lose it.

curl -sSL '{{ install_url }}' | sudo sh
{% endif %}
{% for item in registrations %} {% else %} {% endfor %}
StatusHostLast seenAgent versionReported IPDistro Actions
{{ status_badge(item.state, {'up': 'Reporting', 'stale': 'Silent', 'pending': 'Never reported'}[item.state]) }} {% if item.host %}{{ item.host.name }}{% else %}{{ item.reg.host_id }}{% endif %} {% if item.reg.last_seen_at %}{{ item.reg.last_seen_at|ago }}{% else %}never{% endif %} {{ item.reg.agent_version or "—" }} {{ item.reg.host_ip or "—" }} {{ item.reg.distro or "—" }}
{{ csrf_field() }}
{{ csrf_field() }}
No agents registered yet. Add a host, then install its agent from the host's page.
{% if ansible_available %} {% set scope_select %} {% endset %}

Agent lifecycle via Ansible

These actions run bundled Ansible playbooks to deploy and maintain the Steward monitoring agent on your inventory hosts. Steward generates each host's API token automatically and connects over SSH as the managed steward account — you'll be dropped into the live Ansible run to watch it.

{% if not managed_key_set %}
⚠ No managed SSH key yet — Steward needs one to log into hosts as steward.
{{ csrf_field() }}
{% elif not (deploy_targets or deploy_groups) %}

No Ansible inventory targets yet. Add some under Ansible → Inventory.

{% endif %}
{% if managed_key_set and (deploy_targets or deploy_groups) %}

1 · Provision a fresh host

First contact for a brand-new host. Connects with a one-time bootstrap user + password (used for this run only, never stored), creates the steward login account with passwordless sudo, installs the managed SSH key, then installs the agent. Run this once per host.

{{ csrf_field() }}
{{ scope_select }}

2 · Install / enroll agent

For a host that's already provisioned (has the steward account) but has no agent yet — or to re-enroll one. Connects as steward with the managed key, mints a fresh token, and installs the agent. No curl | sh needed.

{{ csrf_field() }}
{{ scope_select }}

3 · Update agents

Refresh the agent binary on hosts already running it. Connects as steward with the managed key and restarts the service — the token and config are left untouched, so identity is preserved.

{{ csrf_field() }}
{{ scope_select }}
{% endif %} {% endif %} {% endblock %}