Skip to content

feat(examples): ship the inventory templates in collection-fleet - #156

Merged
thiras merged 2 commits into
mainfrom
feat/fleet-inventory
Oct 14, 2026
Merged

thiras merged 2 commits into
mainfrom
feat/fleet-inventory

Conversation

@thiras

@thiras thiras commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Summary

The Galaxy quickstart copied examples/collection-fleet/ and then reached back into ../devops/ansible/inventory/ for the hosts example, group_vars/ and host_vars/, whose comments were written for this repo (make targets, a git-ignored hosts.yml). The fleet example now ships its own inventory/, so the quickstart is one cp -R plus copying hosts-node.yml.example and secret.yml.example.

  • examples/collection-fleet/inventory/: every file the same as ansible/inventory/'s, except the two hosts-*.yml.example headers (the comment block up to the first blank line), which name ansible-playbook decdn.* and a committed hosts.yml.

  • Shared text: the hosts examples' bodies and the group_vars//host_vars/ comments no longer name make targets, INVENTORY= or repo-relative docs//scripts/ paths, so one text reads right in both places.

  • make test-scripts checks:

    • the two copies track the same files, byte for byte apart from the hosts headers;
    • those headers are comments only, with a non-empty body below;
    • both hosts examples parse to the same inventory (ansible-inventory);
    • the ignore rules hold: secret.* ignored, secret.*.example shipped, a filled-in hosts.yml ignored here.

    Eleven negative cases run on a fixture.

  • Root .gitignore: ignores examples/collection-fleet/inventory/hosts.y*ml, so a hosts.yml filled in inside this public checkout never reaches git. The fleet's own .gitignore leaves it alone, since a private copy commits it.

  • Docs: root README quickstart, fleet README, docs/node-operators.md, both collection READMEs, ansible/README.md, AGENTS.md, CONTRIBUTING.md.

Test plan

  • make test-scripts passes, with the new block and its negative cases all ok
  • pre-commit hooks clean (shellcheck, markdownlint, yamllint, check-yaml)
  • Walked the new quickstart in a scratch copy: ansible-inventory --graph and --host resolve decdn-node-1 (and origin-1 under decdn_origin_nodes), with hosts.yml tracked and secret.yml ignored

🤖 Generated with Claude Code

thiras and others added 2 commits October 14, 2026 10:53
The Galaxy quickstart copied examples/collection-fleet/ and then reached back
into ansible/inventory/ for the hosts example, group_vars/ and host_vars/,
whose comments were written for this repo (make targets, a git-ignored
hosts.yml). The fleet example now carries its own inventory/: group_vars/ and
host_vars/ identical to ansible/inventory/'s, and hosts-*.yml.example files
with a fleet header over the same body. The hosts examples' bodies drop make
targets and roles/ paths so one text reads right in both places, and
make test-scripts keeps the two copies equal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups. The drift check could pass while comparing nothing (a
failing git or sed inside a process substitution, renamed directories, a
hosts example without the blank line ending its header). It now runs each
git on its own line, compares every tracked file, requires comment-only
headers and non-empty bodies, checks the ignore rules, and runs eleven
negative cases on a fixture; both hosts examples must also parse to the
same inventory. The root .gitignore keeps a hosts.yml filled in inside
this public checkout out of git. The shared group_vars/host_vars comments
no longer name INVENTORY= or repo-relative docs/scripts paths, and the
docs say where the role and playbook paths live in a fleet repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 08:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The templates, safeguards, tests, and documentation consistently implement the self-contained fleet workflow.

0 open findings

What changed in this PR

Ships self-contained inventory templates with the Galaxy collection fleet example.

Changes:

  • Adds node and publisher inventory templates.
  • Enforces synchronization, parsing, and ignore rules with tests.
  • Updates documentation and quickstarts for the simplified workflow.
File Description
.gitignore Ignores filled fleet inventory files locally.
AGENTS.md Documents inventory synchronization rules.
CONTRIBUTING.md Describes the new script checks.
README.md Simplifies the Galaxy quickstart.
ansible/​README.md Links to the ready-made fleet project.
ansible/​galaxy/​node/​README.md Points node users to the bundled inventory.
ansible/​galaxy/​publisher/​README.md Points publishers to the bundled inventory.
ansible/​inventory/​group_vars/​decdn_nodes.yml Makes comments portable across deployment layouts.
ansible/​inventory/​host_vars/​decdn-node-1/​main.yml Clarifies repository-relative references.
ansible/​inventory/​host_vars/​origin-1/​main.yml Clarifies repository-relative references.
ansible/​inventory/​hosts-node.yml.example Makes shared template comments layout-neutral.
ansible/​inventory/​hosts-publisher.yml.example Makes shared template comments layout-neutral.
docs/​node-operators.md References the bundled node inventory.
examples/​collection-fleet/​README.md Documents the self-contained setup.
examples/​collection-fleet/​inventory/​group_vars/​all.yml Adds common inventory defaults.
examples/​collection-fleet/​inventory/​group_vars/​decdn_nodes.yml Adds shared node configuration.
examples/​collection-fleet/​inventory/​group_vars/​decdn_origin_nodes.yml Adds shared origin configuration.
examples/​collection-fleet/​inventory/​group_vars/​iroh_dns_server_hosts.yml Adds DNS server configuration.
examples/​collection-fleet/​inventory/​group_vars/​iroh_relay_hosts.yml Adds relay configuration.
examples/​collection-fleet/​inventory/​group_vars/​sponsord_hosts.yml Adds sponsord configuration.
examples/​collection-fleet/​inventory/​group_vars/​sponsord_onramp_hosts.yml Adds onramp configuration.
examples/​collection-fleet/​inventory/​host_vars/​decdn-node-1/​main.yml Adds example node settings.
examples/​collection-fleet/​inventory/​host_vars/​decdn-node-1/​secret.yml.example Adds node secret template.
examples/​collection-fleet/​inventory/​host_vars/​origin-1/​main.yml Adds example origin settings.
examples/​collection-fleet/​inventory/​host_vars/​origin-1/​secret.yml.example Adds origin secret template.
examples/​collection-fleet/​inventory/​hosts-node.yml.example Adds collection-oriented node inventory.
examples/​collection-fleet/​inventory/​hosts-publisher.yml.example Adds collection-oriented publisher inventory.
tests/​scripts-test.sh Tests synchronization, parsing, and ignore behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@thiras
thiras merged commit 74853ca into main Oct 14, 2026
56 checks passed
@thiras
thiras deleted the feat/fleet-inventory branch October 14, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants