From 37931434666cb2237fc17c0d6df9f70f569be2b4 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Mon, 15 Jun 2026 14:32:24 +0800 Subject: [PATCH] fix: wait safely for apt locks --- deploy_QMD.yml | 4 +++- deploy_gateway_openclaw.yml | 3 +++ deploy_xworkmate_bridge_vhosts.yml | 3 +++ docs/setup-ai-workspace-all-in-one.md | 5 +++-- setup-ai-agent-skills.yml | 3 +++ setup-nodejs.yml | 3 +++ setup-postgres-standalone.yaml | 3 +++ setup-vault.yaml | 3 +++ setup-xfce-xrdp.yaml | 3 +++ setup-xworkspace-console.yaml | 3 +++ 10 files changed, 30 insertions(+), 3 deletions(-) diff --git a/deploy_QMD.yml b/deploy_QMD.yml index e93b98a..95a2cb6 100644 --- a/deploy_QMD.yml +++ b/deploy_QMD.yml @@ -3,7 +3,9 @@ hosts: "{{ qmd_hosts | default('all') }}" become: true gather_facts: true + module_defaults: + ansible.builtin.apt: + lock_timeout: "{{ ai_workspace_apt_lock_timeout | default(900) | int }}" roles: - role: roles/vhosts/qmd/ tags: [qmd] - diff --git a/deploy_gateway_openclaw.yml b/deploy_gateway_openclaw.yml index 6898bc6..beb4569 100644 --- a/deploy_gateway_openclaw.yml +++ b/deploy_gateway_openclaw.yml @@ -3,6 +3,9 @@ hosts: "{{ gateway_openclaw_hosts | default('all') }}" become: true gather_facts: true + module_defaults: + ansible.builtin.apt: + lock_timeout: "{{ ai_workspace_apt_lock_timeout | default(900) | int }}" roles: - role: roles/vhosts/gateway_openclaw/ tags: [gateway_openclaw, openclaw] diff --git a/deploy_xworkmate_bridge_vhosts.yml b/deploy_xworkmate_bridge_vhosts.yml index fa7dfe7..931953f 100644 --- a/deploy_xworkmate_bridge_vhosts.yml +++ b/deploy_xworkmate_bridge_vhosts.yml @@ -10,6 +10,9 @@ hosts: "{{ xworkmate_bridge_hosts | default('all') }}" become: true gather_facts: true + module_defaults: + ansible.builtin.apt: + lock_timeout: "{{ ai_workspace_apt_lock_timeout | default(900) | int }}" roles: - role: roles/vhosts/acp_server_codex/ tags: [acp_codex] diff --git a/docs/setup-ai-workspace-all-in-one.md b/docs/setup-ai-workspace-all-in-one.md index 114ca41..a5dfbc7 100644 --- a/docs/setup-ai-workspace-all-in-one.md +++ b/docs/setup-ai-workspace-all-in-one.md @@ -37,9 +37,10 @@ ## TODO -- [ ] 等待并核对 `xworkspace-console` 的离线包 GitHub Actions 发布链路,确认 `publish-release` 完整结束且 release 产物上传成功。 +- [x] 等待并核对 `xworkspace-console` 的离线包 GitHub Actions 发布链路,确认 `publish-release` 完整结束且 release 产物上传成功。 - [ ] 继续核对 `root@acp-bridge.onwalk.net` 的远程部署进度,确认 `setup-ai-workspace-all-in-one.sh` 最终完成并输出统一摘要。 -- [ ] `setup-ai-workspace-all-in-one.sh` 在目标主机上优先使用离线安装包加速部署,减少在线拉取与安装耗时。 +- [x] `setup-ai-workspace-all-in-one.sh` 在目标主机上优先使用离线安装包加速部署,减少在线拉取与安装耗时。 +- [ ] 验证 `setup-ai-workspace-all-in-one.sh` 幂等性:同一主机连续执行两次均成功,复用凭据、离线包缓存与已导入镜像,并安全等待部署/APT 锁。 - [ ] 完成最终验收核对:Bridge 对外可达、其余服务默认仅本地监听、`acp-codex` / `opencode` / `gemini` / `hermes` / `qmd` / `litellm` 状态正常。 - [ ] 记录最终提交哈希与远端验证结果,回填到本计划的交付结果部分。 diff --git a/setup-ai-agent-skills.yml b/setup-ai-agent-skills.yml index acf866f..817818e 100644 --- a/setup-ai-agent-skills.yml +++ b/setup-ai-agent-skills.yml @@ -3,6 +3,9 @@ hosts: all become: true gather_facts: true + module_defaults: + ansible.builtin.apt: + lock_timeout: "{{ ai_workspace_apt_lock_timeout | default(900) | int }}" roles: - role: roles/ai_agent_runtime/ when: ai_agent_runtime_enabled | default(true) | bool diff --git a/setup-nodejs.yml b/setup-nodejs.yml index 7bce8be..388964a 100644 --- a/setup-nodejs.yml +++ b/setup-nodejs.yml @@ -2,5 +2,8 @@ hosts: all become: true gather_facts: true + module_defaults: + ansible.builtin.apt: + lock_timeout: "{{ ai_workspace_apt_lock_timeout | default(900) | int }}" roles: - roles/vhosts/nodejs/ diff --git a/setup-postgres-standalone.yaml b/setup-postgres-standalone.yaml index c5fcb43..8f28386 100644 --- a/setup-postgres-standalone.yaml +++ b/setup-postgres-standalone.yaml @@ -3,6 +3,9 @@ hosts: all become: true gather_facts: true + module_defaults: + ansible.builtin.apt: + lock_timeout: "{{ ai_workspace_apt_lock_timeout | default(900) | int }}" roles: - role: roles/vhosts/postgres tags: [postgresql] diff --git a/setup-vault.yaml b/setup-vault.yaml index 9758c2a..4f70ba9 100644 --- a/setup-vault.yaml +++ b/setup-vault.yaml @@ -3,6 +3,9 @@ hosts: all become: true gather_facts: true + module_defaults: + ansible.builtin.apt: + lock_timeout: "{{ ai_workspace_apt_lock_timeout | default(900) | int }}" roles: - role: roles/vhosts/vault/ tags: [vault] diff --git a/setup-xfce-xrdp.yaml b/setup-xfce-xrdp.yaml index 62bc511..756c419 100644 --- a/setup-xfce-xrdp.yaml +++ b/setup-xfce-xrdp.yaml @@ -3,6 +3,9 @@ hosts: all become: true gather_facts: true + module_defaults: + ansible.builtin.apt: + lock_timeout: "{{ ai_workspace_apt_lock_timeout | default(900) | int }}" vars: xworkspace_console_enable_xrdp: false tasks: diff --git a/setup-xworkspace-console.yaml b/setup-xworkspace-console.yaml index f5d1f43..ea4358e 100644 --- a/setup-xworkspace-console.yaml +++ b/setup-xworkspace-console.yaml @@ -3,6 +3,9 @@ hosts: "{{ xworkspace_console_hosts | default('all') }}" become: true gather_facts: true + module_defaults: + ansible.builtin.apt: + lock_timeout: "{{ ai_workspace_apt_lock_timeout | default(900) | int }}" vars: xworkspace_console_user: ubuntu xworkspace_console_public_access: false