Change the way nodejs installed

This commit is contained in:
ArseniiPetrovich 2018-11-29 22:14:20 +03:00
parent 95c1536074
commit 33256001f5
2 changed files with 7 additions and 7 deletions

View File

@ -1,3 +1,2 @@
---
NODE_SOURCE_DEB: "https://deb.nodesource.com/node_8.x"
node_version: 8

View File

@ -2,15 +2,16 @@
- name: Ensure apt-transport-https is installed.
apt: name=apt-transport-https state=present
- name: add nodejs repository key
- name: Install the gpg key for nodejs LTS
become: yes
apt_key:
keyserver: keyserver.ubuntu.com
id: "{{ node_key_id }}"
url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
state: present
- name: Add nodejs repository
- name: Install the nodejs LTS repos
become: yes
apt_repository:
repo: 'deb {{ node_source_deb }} {{ansible_distribution_release}} main'
repo: "deb https://deb.nodesource.com/node_{{ node_version }}.x {{ ansible_distribution_release }} main"
state: present
- name: Install nodejs packages