# 主机清单示例 —— 复制为 inventory.yaml 后填入真实信息 # Inventory.yaml is gitignored to avoid leaking credentials. hosts: # ───── Linux 示例 ───── app-prod-01: address: 10.0.1.10 port: 22 os_family: linux # 可省略,首次连接会自动探测 os_distribution: ubuntu # 可选 connection: ssh user: ops auth: type: key # key | password key_path: ~/.ssh/id_rsa tags: [prod, app] db-prod-01: address: 10.0.1.20 connection: ssh user: ops auth: type: password password: "${SECRET_DB_PROD_01}" # 支持环境变量插值 tags: [prod, db] # ───── Windows 示例 ───── win-app-01: address: 10.0.2.10 port: 5985 os_family: windows connection: winrm user: Administrator auth: type: password password: "${SECRET_WIN_APP_01}" tags: [prod, app] # ───── 本地测试 ───── localhost: address: 127.0.0.1 connection: local # 直接调用本机 shell,方便联调 tags: [dev] groups: prod: [app-prod-01, db-prod-01, win-app-01] linux: [app-prod-01, db-prod-01] windows: [win-app-01] dev: [localhost]