From ad6cef52bae5e18273df039f8eb68adea5f3713b Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 15 Jan 2019 14:05:43 -0500 Subject: [PATCH] attempt to future-proof Sugarizer for new distros --- roles/sugarizer/tasks/main.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index ef494b463..7052d19c3 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -60,19 +60,23 @@ # 3. INSTALL A GOOD VERSION OF Node.js AND npm -- name: Set up Node.js 8.x apt sources (debuntu, but avoid ubuntu-18) +- name: Set up Node.js 8.x apt sources (debuntu distros up to 2017) shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - args: warn: no - when: internet_available and is_debuntu and not is_ubuntu_18 + when: internet_available and (is_debian_8 or is_debian_9 or is_ubuntu_16 or is_ubuntu_17) + # NOT NEC TO TEST FOR is_raspbian_8 OR is_raspbian_9 AS /opt/iiab/iiab/vars/.yml + # DEFINES THESE AS SUBSETS OF is_debian_8 OR is_debian_9 (FOR NOW!) -- name: Install latest Node.js which includes /usr/bin/npm (debuntu, but avoid ubuntu-18) +- name: Install latest Node.js which includes /usr/bin/npm (debuntu distros up to 2017) package: name: nodejs # name: nodejs=8.x state: latest # state: present - when: internet_available and is_debuntu and not is_ubuntu_18 + when: internet_available and (is_debian_8 or is_debian_9 or is_ubuntu_16 or is_ubuntu_17) + +# 2019-01-15: BORROWED BY https://github.com/iiab/iiab/blob/master/roles/nodered/tasks/main.yml#L1-L26 # 2018-07-14: BOTH STEPS ABOVE TAKE TIME, but Raspbian (apt offers npm # 1.4.21) & Debian 9 (apt offers no npm!) STILL NEED the above @@ -93,13 +97,13 @@ # where it upgrades /usr/bin/npm in place: # https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation -- name: Install latest packages nodejs and npm (ubuntu-18 or not debuntu) +- name: Install latest packages nodejs and npm (debuntu distros after 2017, or other distros) package: name: - nodejs - npm state: latest - when: internet_available and (is_ubuntu_18 or not is_debuntu) + when: internet_available and not (is_debian_8 or is_debian_9 or is_ubuntu_16 or is_ubuntu_17) # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules