ansible-config/roles/hopglass-frontend/tasks/install-nodejs.yml
2018-11-03 00:00:16 +01:00

33 lines
774 B
YAML

---
- name: check for npm
find:
paths: [/bin, /usr/bin, /usr/local/bin]
patterns: npm
file_type: any
register: npm
- name: install APT HTTPS transport
apt:
name: apt-transport-https
cache_valid_time: 86400
when: npm.matched == 0
- name: add NodeSource signing key
apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
id: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280
when: npm.matched == 0
- name: add NodeSource repository
apt_repository:
repo: "deb https://deb.nodesource.com/{{ nodejs_version }} {{ ansible_lsb.codename }} main"
filename: nodesource
when: npm.matched == 0
- name: install Node.js
apt:
name:
- build-essential
- nodejs
cache_valid_time: 86400
when: npm.matched == 0