配置参考
这个页面把 README 与 CLI 源码中分散的配置细节汇总为一份统一参考。
全局连接参数
Section titled “全局连接参数”下列参数会通过全局 CLI 选项复用于大多数执行命令。
| 参数 | 来源 | 说明 |
|---|---|---|
--host | CLI | 设备主机名或 IP 地址 |
--username, -u | CLI | SSH 用户名 |
--password, -p | CLI / RAUTO_PASSWORD | SSH 密码 |
--ssh-port, -P | CLI | SSH 端口 |
--enable-password, -e | CLI | Enable / 特权模式密码 |
--ssh-security | CLI | SSH 兼容档位:secure、balanced、legacy-compatible |
--linux-shell-flavor | CLI | Linux shell 退出码解析模式:posix(兼容 bash 别名)或 fish |
--device-profile, -d | CLI | 设备 profile 名称,默认 linux |
--connection | CLI | 按名称使用已保存连接 |
--save-connection | CLI | 成功后保存当前解析出的有效连接 |
--save-password | CLI | 配合 --save-connection 保存密码与 enable 密码 |
--template-dir | CLI / RAUTO_TEMPLATE_DIR | 旧参数,现已废弃;模板与自定义 profile 已存入 SQLite |
运行时环境变量
Section titled “运行时环境变量”rauto 当前暴露的环境变量默认项并不多,但对自动化部署很重要。
| 环境变量 | 用途 | 说明 |
|---|---|---|
RAUTO_PASSWORD | 全局认证 | 默认 SSH 密码 |
RAUTO_MANAGER_URL | rauto agent | 默认 manager 地址 |
RAUTO_AGENT_NAME | rauto agent | 默认 agent 名称 |
RAUTO_AGENT_TOKEN | rauto agent | 默认 agent 认证 token |
RAUTO_MANAGER_REPORT_MODE | rauto agent | 默认上报方式 |
RAUTO_AGENT_PROBE_REPORT_INTERVAL | rauto agent | 默认探测上报间隔 |
RAUTO_HOME | 运行时目录 | 覆盖默认运行目录 ~/.rauto |
默认运行时目录
Section titled “默认运行时目录”默认运行时数据保存在:
~/.rauto├── rauto.db└── backups/其中:
rauto.db- 已保存连接
- 历史录制索引
- 黑名单规则
- 自定义设备 profile
- 命令模板
- 命令流模板
- 执行模板元数据
backups/- 生成的
.tar.gz备份归档
- 生成的
多个执行命令共享同一套录制参数。
| 参数 | 命令 | 说明 |
|---|---|---|
--record-file <path> | exec、template、flow、upload、tx、tx-workflow | 导出 JSONL 录制文件 |
--record-level key-events-only | 同上 | 最小审计级录制 |
--record-level full | 同上 | 更丰富的 prompt / 状态录制 |
源码中的 RecordLevelOpt 当前提供两个枚举值:
KeyEventsOnlyFull
rauto exec
Section titled “rauto exec”| 参数 | 说明 |
|---|---|
--mode, -m | 在指定模式执行命令,例如 Enable、Config、Shell |
rauto template
Section titled “rauto template”| 参数 | 说明 |
|---|---|
--vars, -v | JSON 或 YAML 变量文件 |
--dry-run | 仅渲染不执行 |
rauto flow
Section titled “rauto flow”| 参数 | 说明 |
|---|---|
--template | 已保存命令流模板名 |
--file | 临时 TOML 命令流模板 |
--vars, -v | JSON 变量文件 |
--vars-json | 内联 JSON 变量 |
rauto upload
Section titled “rauto upload”| 参数 | 说明 |
|---|---|
--local-path | 运行 rauto 的本地文件路径 |
--remote-path | 远端目标路径 |
--timeout-secs | 上传超时,默认 300 |
--buffer-size | 可选传输 buffer 大小 |
--show-progress | 输出上传进度日志 |
rauto tx
Section titled “rauto tx”源码里 tx 暴露的控制项比当前概览文档更多。
| 参数 | 说明 |
|---|---|
--name | 事务块名称,用于日志与录制 |
--run-kind | commands 或 command-flow |
--template | 从已保存模板渲染命令 |
--vars | --template 的变量文件 |
--flow-template / --flow-file | 正向命令流来源 |
--flow-vars / --flow-vars-json | 正向命令流变量 |
--rollback-flow-template / --rollback-flow-file | 回滚命令流来源 |
--rollback-flow-vars / --rollback-flow-vars-json | 回滚命令流变量 |
--command | 命令模式下可重复输入的命令 |
--rollback-command | 可重复输入的步骤级回滚命令 |
--rollback-commands-file | 每行一条回滚命令 |
--rollback-commands-json | JSON 数组回滚命令 |
--rollback-on-failure | 在步骤级回滚中,对失败步骤本身也执行回滚 |
--rollback-trigger-step-index | 触发资源级回滚的步骤索引 |
--mode | 目标模式或命令流执行模式 |
--timeout-secs | 每步超时 |
--resource-rollback-command | 显式资源级回滚命令 |
--dry-run | 打印标准化后的 tx 计划 |
--json | JSON 输出结果 |
rauto tx-workflow
Section titled “rauto tx-workflow”| 参数 | 说明 |
|---|---|
workflow_file | 必填,工作流 JSON 路径 |
--dry-run | 打印标准化计划后退出 |
--view | 终端可视化工作流结构 |
--json | 输出原始执行结果 JSON |
rauto orchestrate
Section titled “rauto orchestrate”| 参数 | 说明 |
|---|---|
plan_file | 必填,编排计划 JSON 路径 |
--dry-run | 打印标准化计划后退出 |
--view | 终端可视化编排结构 |
--json | 输出编排结果 JSON |
--record-level | 应用于各目标执行的录制级别 |
rauto replay
Section titled “rauto replay”| 参数 | 说明 |
|---|---|
record_file | JSONL 录制文件路径 |
--list | 列出录制的命令输出事件 |
--command | 回放指定命令 |
--mode | 回放时附加模式过滤 |
Agent 配置
Section titled “Agent 配置”rauto agent 支持 CLI 参数、环境变量和配置文件三层默认项。
Agent CLI 参数
Section titled “Agent CLI 参数”| 参数 | 默认值 | 说明 |
|---|---|---|
--bind | 0.0.0.0 | Agent 监听地址 |
--port | 8123 | Agent 监听端口 |
--manager-url | 无 | 注册与上报使用的 manager 地址 |
--agent-name | 无 | 全局唯一 agent 名称 |
--agent-token | 无 | manager 回调与认证共享密钥 |
--report-mode | 无 | manager 上报方式 |
--agent-config | ~/.rauto/agent.toml | 可选配置文件路径 |
--probe-report-interval | 无 | 周期探测上报间隔(秒) |
Agent 配置文件示例
Section titled “Agent 配置文件示例”[manager]url = "http://manager:50051"token = "my-secret-token"report_mode = "grpc"
[agent]name = "agent-beijing-01"heartbeat_interval = 30probe_report_interval = 300Inventory 配置模型
Section titled “Inventory 配置模型”当前 Inventory 的目标源是已保存连接,而不是一个独立目标数据库。
- 不再维护单独的 inventory target 记录层
- saved connection 负责目标身份、标签、分组与 vars
- Inventory CLI 重点是 group 管理与变量合并预览
变量合并顺序:
- group vars
- saved connection vars
- runtime vars
默认行为与运维边界
Section titled “默认行为与运维边界”根据当前源码与 README:
- 默认设备 profile 是
linux - Web 控制台默认监听
127.0.0.1:3000 - agent 默认监听
0.0.0.0:8123 - upload 默认超时
300秒 - tx 默认名称是
tx-block - replay 读取执行命令生成的 JSONL 录制
- 已保存密码会加密写入 SQLite,但主密钥仍保存在系统 keyring 中