mirror of
https://github.com/frappe/bench.git
synced 2025-01-25 07:58:24 +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
|
# Install's prerequisites, like fonts, image libraries, vim, screen, python-dev and gcc
|
||||||
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
|
- include_tasks: debian_family.yml
|
||||||
yum:
|
when: ansible_os_family == 'Debian'
|
||||||
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'
|
|
||||||
|
|
||||||
- name: Install node v6
|
- include_tasks: redhat_family.yml
|
||||||
yum: name=nodejs state=present
|
when: ansible_os_family == "RedHat"
|
||||||
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'
|
|
||||||
|
|
||||||
- name: Install yarn
|
- name: Install yarn
|
||||||
command: npm install -g yarn
|
command: npm install -g yarn
|
||||||
become: yes
|
become: yes
|
||||||
become_user: root
|
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…
x
Reference in New Issue
Block a user