fix(nodejs): actually run macOS node installation and fix variable name

This commit is contained in:
Haitao Pan 2026-06-21 19:30:38 +08:00
parent aa59be12a0
commit 2a8db4f79a
2 changed files with 5 additions and 1 deletions

View File

@ -2,7 +2,7 @@
- name: Determine Homebrew prefix
ansible.builtin.set_fact:
nodejs_homebrew_prefix: "{{ '/opt/homebrew' if ansible_facts['architecture'] in ['arm64', 'aarch64'] else '/usr/local' }}"
nodejs_homebrew_formula: "node@{{ nodejs_major_version | default(22) }}"
nodejs_homebrew_formula: "node@{{ nodejs_version_major | default(22) }}"
- name: Ensure unversioned Homebrew node formula is absent
community.general.homebrew:

View File

@ -192,3 +192,7 @@
Node.js version: {{ nodejs_installed_version | default('Not installed') }}
NPM version: {{ npm_version_check.stdout if npm_version_check.rc == 0 else 'N/A' }}
Yarn version: {{ yarn_version_check.stdout if yarn_version_check.rc == 0 and install_yarn | default(true) else 'Not installed' }}
- name: Import macOS specific Node.js tasks
ansible.builtin.import_tasks: darwin.yml
when: ansible_os_family == 'Darwin'