656bda2e3d
Ships a read-only "steward-builtin" source (steward/ansible/bundled/) that always appears alongside operator-configured sources, with two playbooks: - maintenance/docker_prune.yml — docker system prune for swarm/standalone nodes (safe by default; prune_all_images / prune_volumes extra-vars to widen). Schedule it against a swarm-node group for recurring cleanup (#869). - host_agent/install.yml — installs/updates the host agent (mirrors install.sh: user, agent.py, config, hardened systemd unit), parameterised with steward_url + steward_token extra-vars. get_sources() now prepends the builtin source. Tests updated to find the configured git source by name; added coverage that the bundled playbooks are discoverable. Tasks #869 + agent-install (milestone #37). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
20 lines
624 B
Python
20 lines
624 B
Python
"""The bundled first-party playbook source is always present and discoverable."""
|
|
from steward.ansible.sources import (
|
|
BUILTIN_SOURCE_NAME,
|
|
discover_playbooks,
|
|
get_sources,
|
|
)
|
|
|
|
|
|
def test_builtin_source_is_first_and_local():
|
|
sources = get_sources({"sources": []})
|
|
assert sources[0]["name"] == BUILTIN_SOURCE_NAME
|
|
assert sources[0]["type"] == "local"
|
|
|
|
|
|
def test_bundled_playbooks_are_discoverable():
|
|
builtin = get_sources({"sources": []})[0]
|
|
playbooks = discover_playbooks(builtin["path"])
|
|
assert "maintenance/docker_prune.yml" in playbooks
|
|
assert "host_agent/install.yml" in playbooks
|