vault_rsync
Sync a local directory to a remote host via rsync over SSH using a vault-stored SSH key, which is temporarily written and then removed for security.
Instructions
Sync a local directory to a remote host using rsync over SSH, with the SSH key fetched from the vault. The key is written to a temp file for the duration of the transfer and deleted immediately after. Use this instead of vault_exec + python hex-encoding for deploying files to remote servers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ssh_key_entry_id | Yes | Vault entry ID containing the SSH private key. | |
| purpose | Yes | Why this transfer is happening (audit log). | |
| local_path | Yes | Local source path. Trailing slash syncs contents; no trailing slash syncs the directory itself. | |
| remote_user | Yes | SSH username on the remote host. | |
| remote_host | Yes | Remote hostname or IP address. | |
| remote_path | Yes | Destination path on the remote host. | |
| extra_args | No | Additional rsync flags, e.g. ["--delete", "--exclude=*.pyc"]. Optional. |