Support running provision.main from Semaphore task templates #3

Merged
sysadmin merged 1 commit from feature/semaphore-task-template-support into main 2026-10-06 13:18:53 +00:00
Contributor

Needed to wire up a Semaphore task template for this collection:

  • playbook_env_source can now be an HTTPS git URL (cloned via a new playbook_env_source_git_token var) since Semaphore only checks out one repository per task template.
  • requirements.yml gets a git self-reference so Semaphore's automatic galaxy-install step installs a correctly-pathed copy of this collection (raw checkouts aren't on the collection path, so FQCN roles wouldn't resolve otherwise).
  • The inventory role now wipes host_vars/topology before re-rendering, since Semaphore's static File inventory is a fixed, reused path rather than a fresh mktemp dir per run.

All three changes verified live against the real homelab repo (clone, parse, filter, wipe-then-render across two differently-scoped runs).

🤖 Generated with Claude Code

https://claude.ai/code/session_012icUrjv3vgHtovVpHUFjdp

Needed to wire up a Semaphore task template for this collection: - `playbook_env_source` can now be an HTTPS git URL (cloned via a new `playbook_env_source_git_token` var) since Semaphore only checks out one repository per task template. - `requirements.yml` gets a git self-reference so Semaphore's automatic galaxy-install step installs a correctly-pathed copy of this collection (raw checkouts aren't on the collection path, so FQCN roles wouldn't resolve otherwise). - The inventory role now wipes `host_vars`/`topology` before re-rendering, since Semaphore's static File inventory is a fixed, reused path rather than a fresh mktemp dir per run. All three changes verified live against the real homelab repo (clone, parse, filter, wipe-then-render across two differently-scoped runs). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012icUrjv3vgHtovVpHUFjdp
Support running provision.main from Semaphore task templates
All checks were successful
Ansible Lint / ansible-lint (pull_request) Successful in 1m7s
7bf7653518
Semaphore (semaphoreui/semaphore) only checks out the single repository
bound to a task template, so a separate checkout of infrastructure/homelab
for playbook_env_source has nothing to mount it from. Let
playbook_env_source be an HTTPS git URL, cloned/updated in-playbook via a
new playbook_env_source_git_token var, instead of requiring a second
repository binding.

Also add a git-sourced self-reference to requirements.yml, since
Semaphore runs this collection as a raw git checkout rather than an
installed collection -- its own automatic galaxy-install step now
installs a correctly-pathed copy so silvarion.provision.* FQCN role
references resolve.

Also wipe host_vars/topology under inventory_render_dir before
re-rendering rather than only ensuring they exist, since a Semaphore
static "File" inventory is a fixed, reused path (not a fresh mktemp dir
per run like scripts/provision.sh) and would otherwise accumulate stale
per-host files across runs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012icUrjv3vgHtovVpHUFjdp
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ansible-collections/silvarion.provision!3
No description provided.