zuul-jobs/roles/install-nodejs/tasks/main.yaml
Andreas Jaeger 6a278c011c Silence ansible-lint
These warnings are ok, disable them.

Change-Id: Ida5ecc81fdaed137ac10baa51643962a5e97b89d
2017-10-27 06:10:31 +02:00

44 lines
1022 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
tags:
# Ignore ANSIBLE0010: We really want latest version
- skip_ansible_lint
- name: Output node version
command: node --version
- name: Output npm version
command: npm --version