zuul-jobs/roles/install-nodejs/tasks/main.yaml
Monty Taylor ad1ce4fc2f
Add base job and roles for javascript
This is in service of getting javascript tarball jobs going.

Change-Id: I20b4b4ce0bdf03c5585ca73471611178c94e2599
2017-10-09 08:32:45 -05:00

41 lines
934 B
YAML

- name: Update apt cache
apt:
update_cache: yes
become: yes
- name: Install prereqs
package:
name: apt-transport-https
state: present
become: yes
- name: Add nodesource repository key
apt_key:
url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
become: yes
- name: Add nodesource apt source repository
apt_repository:
repo: "deb-src https://deb.nodesource.com/node_{{ node_version }}.x {{ ansible_distribution_release }} main"
state: present
become: yes
- name: Add nodesource apt repository
apt_repository:
repo: "deb https://deb.nodesource.com/node_{{ node_version }}.x {{ ansible_distribution_release }} main"
state: present
update_cache: yes
become: yes
- name: Install NodeJS from nodesource
package:
name: nodejs
state: latest
become: yes
- name: Output node version
command: node --version
- name: Output npm version
command: npm --version