Repository navigation
feat: add stash service role - #14
Merged
Merged
Conversation
Installs the Stash backup agent from its release binary and registers the machine to one of the customer's S3 buckets. - The release and its SHA-256 are pinned together in the role (Stash 3.2.4); a download that does not match is never put in place. - Registration only runs while the machine has no Stash config, with a one-time token the platform adds to the role config. The token is passed through the environment and the result is never logged. - A failure in the role never fails the boot playbook. Replaces the placeholder in agents/backup-agent/README.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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
New service role
stash: installs the Stash backup agent (plusclouds/backup.agent) on a Linux VM and registers the machine to one of the customer's S3 buckets.Also replaces the placeholder in
agents/backup-agent/README.md, adds the role to the README table, and regeneratesmanifest.jsonandchecksums.sha256.Why
Today a customer has to log in to the machine, install Stash and paste a registration token by hand. With this role they pick "stash" and a bucket in the existing service-role picker and the machine does the rest at boot.
How the role works
It is included on every boot, so every step is safe to repeat.
stash.linuxfor the release pinned in the role to/usr/local/bin/stash, verified against the SHA-256 pinned next to the version. An existing file that already matches is left alone; a download that does not match is never put in place. Pinned: Stash 3.2.4./etc/plusclouds/stash.yamland the platform supplied a token, runsstash register. Registration writes the config and installs and starts thestashsystemd unit itself.Any failure ends in a
rescuethat prints which task failed. The boot playbook always continues.Config keys
defaults.ymlbucketregistration_tokenregister_endpointThe platform resolves
bucketinside the customer's own account and only then adds a one-time, short-lived token to this machine's metadata. The two platform keys are left out ofdefaults.ymlon purpose, so they do not show in the panel picker.Secrets
STASH_REGISTER_TOKENenvironment variable, not the command line (needs Stash 3.2.4, which added this).stash registerprints the agent API key and the S3 secret on success, so that task and the one reading the role config areno_log.Unlike the other roles that download release binaries (prometheus, node_exporter, minio), this one verifies a checksum.
Testing
Run in an amd64 container with a playbook shaped like the one IAAS renders:
stash version v3.2.4ansible-lintpasses on the role and on the full file set CI checks.manifest.jsonregenerates identically andchecksums.sha256verifies.Not tested: a successful registration against the platform, a machine with real systemd, AlmaLinux with SELinux enforcing, and a real VM boot from a config ISO.
Not in this PR
The role does nothing beyond installing Stash until the platform supplies the token. That part (an extension point in IAAS, filled in by leo4) is separate work, as is pointing
TOOLKIT_VERSIONat a release that contains this role. Windows is not covered.🤖 Generated with Claude Code