mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 00:37:51 +00:00
changed node version install from 6 to 8
- broken down the node install into multiple parts based on OS - change the default node version to be installed from 6 to 8
This commit is contained in:
parent
12f93976d0
commit
348e38f37a
23
playbooks/roles/nodejs/tasks/debian_family.yml
Normal file
23
playbooks/roles/nodejs/tasks/debian_family.yml
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Add apt key for node repo
|
||||
apt_key:
|
||||
url: https://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x1655A0AB68576280
|
||||
id: "68576280"
|
||||
state: present
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Add repo
|
||||
apt_repository:
|
||||
repo: "deb [arch=amd64,i386] https://deb.nodesource.com/node_8.x {{ ansible_distribution_release }} main"
|
||||
state: present
|
||||
register: node_repo
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Install nodejs 8.x
|
||||
apt:
|
||||
name: nodejs
|
||||
state: present
|
||||
update_cache: yes
|
||||
force: yes
|
||||
when: ansible_os_family == 'Debian'
|
||||
...
|
@ -1,44 +1,14 @@
|
||||
---
|
||||
- name: Import Node source RPM key
|
||||
rpm_key:
|
||||
key: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
|
||||
state: present
|
||||
when: ansible_os_family == 'RedHat'
|
||||
# Install's prerequisites, like fonts, image libraries, vim, screen, python-dev and gcc
|
||||
|
||||
- name: Add Node Repo for RedHat
|
||||
yum:
|
||||
name: 'https://rpm.nodesource.com/pub_6.x/el/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/nodesource-release-el{{ ansible_distribution_major_version }}-1.noarch.rpm'
|
||||
state: present
|
||||
update_cache: yes
|
||||
when: ansible_os_family == 'RedHat'
|
||||
- include_tasks: debian_family.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Install node v6
|
||||
yum: name=nodejs state=present
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- name: Add apt key for node repo
|
||||
apt_key:
|
||||
url: https://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x1655A0AB68576280
|
||||
id: "68576280"
|
||||
state: present
|
||||
when: ansible_os_family == 'Debian' or ansible_distribution == 'Ubuntu'
|
||||
|
||||
- name: Add repo
|
||||
apt_repository:
|
||||
repo: "deb [arch=amd64,i386] https://deb.nodesource.com/node_6.x {{ ansible_distribution_release }} main"
|
||||
state: present
|
||||
register: node_repo
|
||||
when: ansible_os_family == 'Debian' or ansible_distribution == 'Ubuntu'
|
||||
|
||||
- name: Install nodejs 6.x
|
||||
apt:
|
||||
name: nodejs
|
||||
state: present
|
||||
update_cache: yes
|
||||
force: yes
|
||||
when: ansible_os_family == 'Debian' or ansible_distribution == 'Ubuntu'
|
||||
- include_tasks: redhat_family.yml
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: Install yarn
|
||||
command: npm install -g yarn
|
||||
become: yes
|
||||
become_user: root
|
||||
...
|
18
playbooks/roles/nodejs/tasks/redhat_family.yml
Normal file
18
playbooks/roles/nodejs/tasks/redhat_family.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Import Node source RPM key
|
||||
rpm_key:
|
||||
key: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
|
||||
state: present
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- name: Add Node Repo for RedHat
|
||||
yum:
|
||||
name: 'https://rpm.nodesource.com/pub_8.x/el/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/nodesource-release-el{{ ansible_distribution_major_version }}-1.noarch.rpm'
|
||||
state: present
|
||||
update_cache: yes
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- name: Install node v8
|
||||
yum: name=nodejs state=present
|
||||
when: ansible_os_family == 'RedHat'
|
||||
...
|
Loading…
Reference in New Issue
Block a user