canasta gitops set-role

From Canasta Wiki

canasta > gitops > set-role

canasta gitops set-role

Change a host's role in the gitops repository

Synopsis

Set the role of a host in hosts/hosts.yaml and push that change alone. Run it on a host that can push (role source or both). A sink host only pulls, and its recorded CLI version is not compared with the other hosts'. The last host that can push cannot be given role sink.

The change is made on top of the repository's main branch as it is on the remote, and holds only hosts/hosts.yaml: nothing staged, changed or committed on this host goes with it, and this host's files are not changed until its next canasta gitops pull. It runs whatever the CLI versions of the other hosts, so a host whose pull and push stop on another host's newer CLI can still run it.

canasta gitops set-role [flags]

Examples

canasta gitops set-role --host-name staging --role sink

Flags

Flag Shorthand Description Default Required Orchestrator
--host-name Name of the host in hosts/hosts.yaml ✓ Both
--role New role for the host ✓ Both
--id -i Canasta instance ID * Both
--key Compose only. Path on the controller (the machine running canasta) to the git-crypt symmetric key, used to unlock the checkout if it is locked. Without it, a repo with GPG recipients is unlocked through a forwarded GPG agent. Both
--ssh-key Path on the instance's host to an SSH private key for git network operations. When set, git runs with GIT_SSH_COMMAND="ssh -i <ssh-key> ...". On a remote host, give an absolute path or one starting with a quoted '~' (for example '~/x'). On Compose, the instance remembers the path, and later gitops commands use it when --ssh-key is omitted; passing it again replaces it. Without a remembered key, git uses ssh-agent forwarding on Compose, or the staged deploy key on Kubernetes. Both

* Defaults to the Canasta instance matching the current directory, if any.

Global flags

Flag Shorthand Description Default Required Orchestrator
--help -h Show help message and exit Both
--verbose -v Enable verbose output Both