26 lines
774 B
YAML
26 lines
774 B
YAML
---
|
|
- name: Install and configure npm/nvm/yarn
|
|
tags: npm
|
|
become: true
|
|
become_user: "{{ default_user }}"
|
|
block:
|
|
- name: Install nvm
|
|
shell: "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/{{ nvm_version }}/install.sh | bash"
|
|
args:
|
|
creates: "{{ default_user_home }}/.nvm/nvm.sh"
|
|
|
|
- name: Install latest node/npm
|
|
shell: "source {{ default_user_home }}/.nvm/nvm.sh && nvm install node"
|
|
args:
|
|
executable: /bin/bash
|
|
|
|
- name: Activate latest version
|
|
shell: "source {{ default_user_home }}/.nvm/nvm.sh && nvm use node"
|
|
args:
|
|
executable: /bin/bash
|
|
|
|
- name: Install Yarn
|
|
shell: "source {{ default_user_home }}/.nvm/nvm.sh && npm install -g yarn"
|
|
args:
|
|
executable: /bin/bash
|