File tree Expand file tree Collapse file tree
ansible/roles/pwa-html/tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- - name : Download nodesource APT repo script
2+ - name : Install dependencies for nvm
3+ apt :
4+ pkg :
5+ - curl
6+ - zip
7+ state : present
8+ update_cache : yes
9+
10+ - name : Download nvm install script
311 get_url :
4- url : https://deb.nodesource .com/setup_22.x
5- dest : /tmp/setup-node-apt-source .sh
6- mode : 777
12+ url : https://raw.githubusercontent .com/nvm-sh/nvm/v0.40.1/install.sh
13+ dest : /tmp/install-nvm .sh
14+ mode : " 0755 "
715
8- - name : Setup nodesoure APT repo
9- shell : /tmp/setup-node-apt-source .sh
16+ - name : Install nvm
17+ shell : /tmp/install-nvm .sh
1018 args :
11- creates : /etc/apt/sources.list.d/nodesource.list
19+ creates : /root/.nvm/nvm.sh
1220 executable : bash
21+ environment :
22+ HOME : /root
1323
14- - name : Install Packages
15- apt :
16- pkg :
17- - nodejs
18- - zip
19- state : latest
24+ - name : Install Node.js v22.21.1 using nvm
25+ shell : |
26+ . /root/.nvm/nvm.sh
27+ nvm install v22.21.1
28+ nvm alias default v22.21.1
29+ args :
30+ creates : /root/.nvm/versions/node/v22.21.1
31+ executable : bash
32+ environment :
33+ HOME : /root
34+
35+ - name : Create symlinks for node and npm in /usr/local/bin
36+ shell : |
37+ . /root/.nvm/nvm.sh
38+ ln -sf $(which node) /usr/local/bin/node
39+ ln -sf $(which npm) /usr/local/bin/npm
40+ args :
41+ executable : bash
42+ environment :
43+ HOME : /root
2044
2145- name : Install Workbox-CLI
2246 npm :
You can’t perform that action at this time.
0 commit comments