Files
env-ansible/tasks/workstation/linux/software/nodejs.yml
T

48 lines
1.1 KiB
YAML

---
# 20260730 - Hyperling
# Install much more recent Node versions.
# https://linuxcapable.com/how-to-install-node-js-on-debian-linux/
- name: Workstation | Software | NodeJS
block:
- name: Workstation | Software | NodeJS | apt
block:
- name: Workstation | Software | NodeJS | apt | Facts
set_fact:
node_version: node_24.x
- name: Workstation | Software | NodeJS | apt | Old | Remove
package:
name: npm
state: absent
- name: Workstation | Software | NodeJS | apt | extrepo | Install
package:
name: extrepo
state: present
update_cache: yes
- name: Workstation | Software | NodeJS | apt | extrepo | Enable
shell: "extrepo enable {{ node_version }}"
- name: Workstation | Software | NodeJS | apt | Install
package:
name: nodejs
state: latest
update_cache: yes
when: ansible_pkg_mgr == "apt"
- name: Workstation | Software | NodeJS | All Others | Install
package:
name:
- nodejs
- npm
state: present
when: ansible_pkg_mgr != "apt"
when: coding == true