-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnvm.yml
More file actions
33 lines (30 loc) · 1.46 KB
/
nvm.yml
File metadata and controls
33 lines (30 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
- name: Install nvm, Node.js, and Gemini CLI
hosts: localhost
tasks:
- name: Install nvm (Node Version Manager)
tags: dev
become: false # Run as the current user, not root
shell: 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash'
args:
# This makes the task idempotent; it won't run if nvm is already installed.
creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh"
- name: Install latest node.js with nvm and set as default
tags: dev
become: false # Run as the current user
shell: '. {{ ansible_env.HOME }}/.nvm/nvm.sh && nvm install node && nvm alias default node'
args:
# This task won't run if a default node version is already set.
creates: "{{ ansible_env.HOME }}/.nvm/alias/default"
- name: Check if gemini-cli is already installed
tags: dev
become: false # Run as the current user
shell: '. {{ ansible_env.HOME }}/.nvm/nvm.sh && npm list -g @google/gemini-cli'
register: gemini_cli_check
changed_when: false # This task doesn't change anything
failed_when: false # Don't fail the playbook if the package isn't found
- name: Install gemini-cli with npm
tags: dev
become: false # Run as the current user
shell: '. {{ ansible_env.HOME }}/.nvm/nvm.sh && npm install -g @google/gemini-cli'
# Only run this task if the gemini-cli was not found in the previous step.
when: gemini_cli_check.rc != 0