Repository navigation
feat(galaxy): ship the playbooks in the collections - #154
Merged
Merged
Conversation
decdn.node and decdn.publisher now carry the playbooks this repo deploys with, and their group_vars/, so a fleet runs from an inventory and the collections alone (ansible-playbook decdn.publisher.site), firewall holes, placement checks and lifecycle guards included. - galaxy/<collection>/playbooks.txt lists what each ships; decdn.node takes node.yml plus node-only backup.yml/decommission.yml (galaxy/node/playbooks/, kept equal to the fleet-wide node plays by make test-scripts), decdn.publisher every playbook, so a run never mixes two releases' group_vars/. - galaxy/stage-playbooks.py qualifies role references at staging only and refuses any form it cannot (include_role names are not resolved by --syntax-check), checks tasks_from and keeps imports inside the collection. - galaxy/check-playbooks.sh, run by galaxy-check-<collection>, installs the tarball, syntax-checks every playbook by FQCN and probes the firewall holes as a collection playbook; molecule/collection runs decdn.node's playbooks end to end with no roles path. - decdn_backup_local_dir / sponsord_backup_local_dir: from a collection playbook, backups/ beside the project's ansible.cfg, never the installed collection. - release.sh counts the shipped playbooks, their group_vars/ and stage-playbooks.py; decdn.publisher now needs decdn.node >=0.2.0. - examples/collection-fleet/: a consumer project skeleton. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The packaging, release integration, lifecycle behavior, and consumer workflow are comprehensively validated.
0 open findings
What changed in this PR
Ships deployment playbooks and shared variables in both Galaxy collections, enabling inventory-only fleet deployment.
Changes:
- Adds playbook staging with FQCN role rewriting and validation.
- Adds consumer-level checks, Molecule coverage, and release tracking.
- Documents collection usage and provides a starter fleet project.
| File | Description |
|---|---|
tests/scripts-test.sh |
Tests staging, lifecycle copies, and release paths. |
scripts/release.sh |
Tracks shipped playbooks in releases. |
RELEASING.md |
Documents release scope. |
README.md |
Advertises collection playbooks. |
Makefile |
Clarifies Galaxy validation. |
examples/collection-fleet/requirements.yml |
Defines collection dependencies. |
examples/collection-fleet/README.md |
Documents fleet setup. |
examples/collection-fleet/ansible.cfg |
Configures collection-based runs. |
examples/collection-fleet/.gitignore |
Excludes secrets, backups, and installations. |
docs/publishers.md |
Documents publisher playbooks. |
docs/node-operators.md |
Documents node playbooks. |
CONTRIBUTING.md |
Describes expanded checks. |
ansible/tests/firewall-holes/check.sh |
Supports installed-collection validation. |
ansible/roles/sponsord/defaults/main.yml |
Relocates collection-run backups safely. |
ansible/roles/decdn_node/defaults/main.yml |
Relocates collection-run backups safely. |
ansible/README.md |
Documents collection packaging and usage. |
ansible/playbooks/sponsord.yml |
Updates collection-related commentary. |
ansible/playbooks/origin.yml |
Updates collection-related commentary. |
ansible/playbooks/node.yml |
Documents collection invocation. |
ansible/playbooks/iroh_relay.yml |
Updates collection-related commentary. |
ansible/playbooks/iroh_dns_server.yml |
Updates collection-related commentary. |
ansible/playbooks/decommission.yml |
Documents collection lifecycle usage. |
ansible/playbooks/backup.yml |
Documents collection backup usage. |
ansible/molecule/collection/verify.yml |
Verifies backup and decommission results. |
ansible/molecule/collection/prepare.yml |
Builds and installs the node collection. |
ansible/molecule/collection/molecule.yml |
Defines collection consumer testing. |
ansible/molecule/collection/converge.yml |
Exercises shipped playbooks by FQCN. |
ansible/Makefile |
Integrates consumer-level checks. |
ansible/galaxy/stage-playbooks.py |
Stages and validates collection playbooks. |
ansible/galaxy/publisher/README.md |
Documents publisher playbooks. |
ansible/galaxy/publisher/playbooks.txt |
Lists publisher playbooks. |
ansible/galaxy/publisher/galaxy.yml |
Raises the node dependency floor. |
ansible/galaxy/node/README.md |
Documents node playbooks. |
ansible/galaxy/node/playbooks/decommission.yml |
Adds node-only decommissioning. |
ansible/galaxy/node/playbooks/backup.yml |
Adds node-only backup. |
ansible/galaxy/node/playbooks.txt |
Lists node playbooks. |
ansible/galaxy/node/galaxy.yml |
Updates packaging commentary. |
ansible/galaxy/check-playbooks.sh |
Validates installed playbooks and variables. |
ansible/galaxy/build.sh |
Adds playbook staging to collection builds. |
ansible/.ansible-lint |
Excludes runtime-only collection convergence. |
AGENTS.md |
Records the new packaging conventions. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
decdn.nodeanddecdn.publishernow ship the playbooks this repo deploys with, and theirplaybooks/group_vars/. Someone who installs them from Galaxy needs only an inventory:ansible-playbook -i inventory/hosts.yml decdn.publisher.sitedoes whatmake deploydoes, firewall holes, placement checks and lifecycle guards included. Until now the collections shipped roles only, so every consumer had to rebuild that glue by hand.How
galaxy/<collection>/playbooks.txtlists each collection's playbooks.decdn.node:node.yml, plus node-onlybackup.yml/decommission.ymlingalaxy/node/playbooks/.make test-scriptskeeps those equal to the fleet-wide node plays, in both directions.decdn.publisher: every playbook, its ownnode.ymlincluded. A run never imports across collections, so it never mixes two releases'group_vars/.group_vars/beside it, with the same precedence as in this repo. I confirmed that in ansible-core's source and with a probe run as a collection playbook.galaxy/stage-playbooks.py(stdlib, called bybuild.sh) rewrites role references to FQCNs at staging only. The repo's playbooks stay unqualified, so an installed collection can never stand in forroles/on a deploy. It refuses any role-reference form it cannot qualify, checks eachtasks_fromexists, and refuses animport_playbookthat doesn't ship. That check matters because--syntax-checkdoes not resolveinclude_role.decdn_backup_local_dir/sponsord_backup_local_dirused to put a collection run's fetched backups inside the installed collection, where an upgrade would delete them. From a collection playbook they now go tobackups/beside the project'sansible.cfg, or the run fails loudly if there is no projectansible.cfg. Repo runs are unchanged.release.shcounts the shipped playbooks,group_vars/andstage-playbooks.pyin each collection's changelog.decdn.publishernow depends ondecdn.node >=0.2.0.examples/collection-fleet/is a consumer project skeleton:requirements.yml,ansible.cfgand.gitignore.ansible/README.md,AGENTS.md,RELEASING.md,CONTRIBUTING.mdand the operator front doors.Tests
make galaxy-check-<collection>now also runsgalaxy/check-playbooks.sh. It installs the tarball, syntax-checks every shipped playbook by FQCN, and runs the firewall-holes check against the installed collection.collection. It builds and installsdecdn.node, then runsdecdn.node.node→.backup→.decommissionwith an empty roles path. It checks where the fetched backup lands and what decommission removes.make test-scriptscovers:ansible.legacynames;make test-scripts,make galaxy-check,make lint,make lint-ansible,make security-ansiblemake molecule SCENARIOS='collection lifecycle'check-playbooks.shand the backup default on ansible-core 2.15.13, the collections' floordecdn.publisher.site --list-tasksfrom the example project matchesplaybooks/site.yml --list-tasksexactly, apart from FQCN prefixesNotes
check-playbooks.shdoes that check properly.>=0.2.0floors assume this is released asnode-collection-v0.2.0, thenpublisher-collection-v0.2.0. Release node first, becauserelease.shrefuses the publisher release until a node tag satisfies the floor.🤖 Generated with Claude Code