fix(gateway_openclaw): resolve npm path resolution, remove obsolete plugins via CLI, and make doctor non-interactive

This commit is contained in:
Haitao Pan 2026-06-21 20:10:50 +08:00
parent 85bad4155f
commit aa3b4e8069
4 changed files with 7 additions and 7 deletions

View File

@ -34,7 +34,7 @@ gateway_openclaw_config_path: "{{ gateway_openclaw_home }}/.openclaw/openclaw.js
gateway_openclaw_workspace_path: "{{ gateway_openclaw_home }}/.openclaw/workspace"
gateway_openclaw_workspace_mode: "0775"
gateway_openclaw_compile_cache_dir: /var/tmp/openclaw-compile-cache
gateway_openclaw_service_path: "/opt/homebrew/opt/node@24/bin:{{ gateway_openclaw_home }}/.nix-profile/bin:{{ gateway_openclaw_home }}/.local/bin:{{ gateway_openclaw_home }}/.npm-global/bin:{{ gateway_openclaw_home }}/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
gateway_openclaw_service_path: "{{ gateway_openclaw_home }}/.nix-profile/bin:{{ gateway_openclaw_home }}/.local/bin:{{ gateway_openclaw_home }}/.npm-global/bin:{{ gateway_openclaw_home }}/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
gateway_openclaw_extension_backup_dir: "{{ gateway_openclaw_home }}/.openclaw/backups/extensions"
gateway_openclaw_upstream_host: 127.0.0.1

View File

@ -1,12 +1,12 @@
---
- name: Run OpenClaw doctor (POSIX)
ansible.builtin.command: "{{ gateway_openclaw_binary_path }} doctor --fix --force"
ansible.builtin.command: "{{ gateway_openclaw_binary_path }} doctor --fix --force --non-interactive --yes"
environment:
HOME: "{{ gateway_openclaw_home }}"
PATH: "{{ gateway_openclaw_service_path }}"
OPENCLAW_NO_RESPAWN: "1"
NODE_COMPILE_CACHE: "{{ gateway_openclaw_compile_cache_dir }}"
become: "{{ ansible_os_family == 'Debian' }}"
become: true
become_user: "{{ gateway_openclaw_service_user }}"
when:
- not ansible_check_mode

View File

@ -1,6 +1,6 @@
---
- name: Execute OpenClaw doctor
community.windows.win_command: "{{ gateway_openclaw_home }}\\.local\\node_modules\\openclaw\\bin\\openclaw.cmd doctor --fix --force"
community.windows.win_command: "{{ gateway_openclaw_home }}\\.local\\node_modules\\openclaw\\bin\\openclaw.cmd doctor --fix --force --non-interactive --yes"
environment:
OPENCLAW_NO_RESPAWN: "1"
NODE_COMPILE_CACHE: "{{ gateway_openclaw_compile_cache_dir }}"

View File

@ -71,7 +71,7 @@
- name: Install required OpenClaw gateway package version
ansible.builtin.command:
cmd: >-
npm install --global --omit=dev --no-audit --no-fund
/usr/bin/env npm install --global --omit=dev --no-audit --no-fund
--prefix "{{ gateway_openclaw_home }}/.local"
"{{ gateway_openclaw_npm_package_spec }}"
environment:
@ -295,7 +295,7 @@
- name: Repair OpenClaw package runtime dependencies as service user
ansible.builtin.command:
cmd: npm install --omit=dev --no-audit --no-fund --prefix "{{ gateway_openclaw_install_dir }}"
cmd: /usr/bin/env npm install --omit=dev --no-audit --no-fund --prefix "{{ gateway_openclaw_install_dir }}"
environment:
HOME: "{{ gateway_openclaw_home }}"
PATH: "{{ gateway_openclaw_service_path }}"
@ -321,7 +321,7 @@
- name: Repair OpenClaw extension runtime dependencies as service user
ansible.builtin.command:
cmd: npm install --omit=dev --no-audit --no-fund --prefix "{{ item.item }}"
cmd: /usr/bin/env npm install --omit=dev --no-audit --no-fund --prefix "{{ item.item }}"
environment:
HOME: "{{ gateway_openclaw_home }}"
PATH: "{{ gateway_openclaw_service_path }}"