From 27871463cb8bb3b55084b9e9785097c30278acad Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 09:09:34 -0400 Subject: [PATCH 01/15] Update main.yml --- roles/sugarizer/defaults/main.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index 8f5c40c57..58e822327 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -5,13 +5,11 @@ sugarizer_location: "{{ iiab_base }}" # /opt/iiab sugarizer_version: sugarizer-1.0 sugarizer_git_version: v1.0.1 -# PLEASE HELP MONITOR https://github.com/llaske/sugarizer/releases FOR -# STABLE/OFFICIAL RELEASES! +# PLEASE HELP MONITOR https://github.com/llaske/sugarizer/releases sugarizer_server_version: sugarizer-server-1.0 -sugarizer_server_git_version: master -# CLONING SUGARIZER-SERVER'S MASTER BRANCH IS NOT A LONG-TERM SOLUTION, -# SO LET'S MONITOR https://github.com/llaske/sugarizer-server/releases -# FOR A MORE STABLE/OFFICIAL RELEASE DURING MID-2018! +sugarizer_server_git_version: v1.0.1 # was "master" 11-14 July 2018 +# PLEASE HELP MONITOR https://github.com/llaske/sugarizer-server/releases -node_modules_exists: False +# Unused as of 2018-07-14 +# node_modules_exists: False From 81412a6265815a9be0980d82a12517ef1fe95bbb Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 09:22:50 -0400 Subject: [PATCH 02/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 70 +++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index b5914dae5..d931aed2b 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -31,6 +31,10 @@ # Going forward let's "git clone" IIAB's preferred versions, of sugarizer # AND sugarizer-server, as specified in roles/sugarizer/defaults/main.yml +# 2018-07-14 BLOWBACK: git works well BUT even with "depth: 1" +# - 229MB is unfort downloaded to /opt/iiab/sugarizer/.git +# - 1.4MB is unfort downloaded to /opt/iiab/sugarizer-server/.git + - name: Clone llaske/sugarizer-server ({{ sugarizer_server_git_version }}) from GitHub to /opt/iiab git: repo: https://github.com/llaske/sugarizer-server @@ -48,8 +52,8 @@ # 3. INSTALL A GOOD VERSION OF Node.js AND npm -# Both Raspbian and Debian 9 STILL need this approach as of July 2018, -# as documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 +# Raspbian & Debian 9 STILL need this approach (July 2018) to get a recent +# version of npm. As documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 - name: Set up Node.js 8.x apt sources (debuntu but avoid ubuntu-18) shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - when: internet_available and is_debuntu and not is_ubuntu_18 @@ -57,56 +61,60 @@ - name: Install latest Node.js which includes /usr/bin/npm (debuntu but avoid ubuntu-18) package: name: nodejs - # name: nodejs=8.x state: latest + # name: nodejs=8.x # state: present when: internet_available and is_debuntu and not is_ubuntu_18 -- name: Install Node.js and npm (ubuntu-18) +#- name: Install Node.js and npm (ubuntu-18) +- name: Install Node.js and npm (ubuntu-18 or not is_debuntu) package: name: "{{ item }}" state: latest - when: internet_available and is_ubuntu_18 + when: internet_available and (is_ubuntu_18 or (not is_debuntu)) with_items: - nodejs - npm -- name: Install npm (OS's other than debuntu) - package: - name: "{{ item }}" - state: present - when: internet_available and not is_debuntu - with_items: - - nodejs - - npm +#- name: Install npm (OS's other than debuntu) +# package: +# name: "{{ item }}" +# state: present +# when: internet_available and not is_debuntu +# with_items: +# - nodejs +# - npm # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules -# Re-running "npm install" fails on Raspbian 9 if not other OS's -- name: Check for /opt/iiab/{{ sugarizer_server_version }}/node_modules - stat: - path: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" - register: nmtest - ignore_errors: true +# OLD WAY: Re-running "npm install" fails on Raspbian 9 if not other OS's, so... -- name: Set a flag to prevent re-running of "npm install" - set_fact: - node_modules_exists: True - when: nmtest.stat is defined and nmtest.stat.exists +#- name: Check for /opt/iiab/{{ sugarizer_server_version }}/node_modules +# stat: +# path: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" +# register: nmtest +# ignore_errors: true +# +#- name: Set a flag to prevent re-running of "npm install" +# set_fact: +# node_modules_exists: True +# when: nmtest.stat is defined and nmtest.stat.exists -- name: Create the express framework for Node.js (OS's other than Fedora 18) +# NEW WAY: "creates: ..." below (checks for existence of "node_modules") + +#- name: Create the express framework for Node.js (OS's other than Fedora 18) +- name: Run 'npm install' to create the express framework for Node.js shell: npm install args: chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" - #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/server/node_modules" - when: not is_F18 and not node_modules_exists +# when: not is_F18 and not node_modules_exists -- name: Create the express framework for Node.js (Fedora 18) - shell: npm install - args: - chdir: "{{ sugarizer_location }}/sugarizer/server" - when: is_F18 and not node_modules_exists +#- name: Create the express framework for Node.js (Fedora 18) +# shell: npm install +# args: +# chdir: "{{ sugarizer_location }}/sugarizer/server" +# when: is_F18 and not node_modules_exists # 5. PLACE CONFIG FILES From f2aa427579803aea9d924750fa5e5b56bc8877bf Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 11:59:26 -0400 Subject: [PATCH 03/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index d931aed2b..3b4df747c 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -52,17 +52,19 @@ # 3. INSTALL A GOOD VERSION OF Node.js AND npm -# Raspbian & Debian 9 STILL need this approach (July 2018) to get a recent -# version of npm. As documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 -- name: Set up Node.js 8.x apt sources (debuntu but avoid ubuntu-18) +# Raspbian & Debian 9 STILL need this nodesource.com approach (July 2018) to get a recent version of npm. +# As documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 +# This nodesource.com approach (brings in npm 5.6.0 with nodejs 8.11.3) +# would also work on Ubuntu 18.04, but U18's apt brings in npm 3.5.2, which is sufficient (SO FAR!?) +- name: Set up Node.js 8.x apt sources (debuntu, but avoid ubuntu-18) shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - when: internet_available and is_debuntu and not is_ubuntu_18 -- 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, but avoid ubuntu-18) package: name: nodejs - state: latest # name: nodejs=8.x + state: latest # state: present when: internet_available and is_debuntu and not is_ubuntu_18 @@ -87,7 +89,14 @@ # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules -# OLD WAY: Re-running "npm install" fails on Raspbian 9 if not other OS's, so... +# Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's. +# Several strategies to avoid re-running it: +# OLD WAY 1: test & set flag node_modules_exists: True +# OLD WAY 2: "creates: ..." checks for non-existence of /opt/iiab/sugarizer-server-1.0/node_modules +# OLD WAY 3: set "register: git_sug_server_output" above, then as nec delete /opt/iiab/sugarizer-server-1.0/node_modules "when: git_sug_server_output.changed" and as nec run "npm install" + +# NEW WAY: run "npm install" every time, as modern versions of npm are +# incremental, with sanity checks (as tested with npm 3.5.2 and 5.6.0) #- name: Check for /opt/iiab/{{ sugarizer_server_version }}/node_modules # stat: @@ -100,15 +109,14 @@ # node_modules_exists: True # when: nmtest.stat is defined and nmtest.stat.exists -# NEW WAY: "creates: ..." below (checks for existence of "node_modules") - #- name: Create the express framework for Node.js (OS's other than Fedora 18) -- name: Run 'npm install' to create the express framework for Node.js - shell: npm install +- name: Run 'npm install' to create /opt/iiab/{{ sugarizer_server_version }}/node_modules (CAN TAKE SEVERAL MINUTES) + command: npm install # slightly safer than "shell:" args: chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" - creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" -# when: not is_F18 and not node_modules_exists +# creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" # OLD WAY 2 +# when: git_sug_server_output.changed # OLD WAY 3 +# when: not is_F18 and not node_modules_exists # OLD WAY 1 #- name: Create the express framework for Node.js (Fedora 18) # shell: npm install @@ -144,7 +152,7 @@ enabled: yes state: restarted with_items: - - { name: mongodb } +# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot does usually does! (Is a daemon-reload or some such nec?) - { name: sugarizer } when: sugarizer_enabled From ceec00d9ac255aa661cac4474eb5f1705e09fc2e Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 12:01:05 -0400 Subject: [PATCH 04/15] Update main.yml --- roles/sugarizer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/defaults/main.yml b/roles/sugarizer/defaults/main.yml index 58e822327..1b0d7f0bf 100644 --- a/roles/sugarizer/defaults/main.yml +++ b/roles/sugarizer/defaults/main.yml @@ -8,7 +8,7 @@ sugarizer_git_version: v1.0.1 # PLEASE HELP MONITOR https://github.com/llaske/sugarizer/releases sugarizer_server_version: sugarizer-server-1.0 -sugarizer_server_git_version: v1.0.1 # was "master" 11-14 July 2018 +sugarizer_server_git_version: v1.0.1 # "master" worked over July 11-14, 2018 # PLEASE HELP MONITOR https://github.com/llaske/sugarizer-server/releases # Unused as of 2018-07-14 From 59aec67a559773525a5525c588a3ae22d2466c57 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 12:11:50 -0400 Subject: [PATCH 05/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 3b4df747c..2edffb9bd 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -69,11 +69,11 @@ when: internet_available and is_debuntu and not is_ubuntu_18 #- name: Install Node.js and npm (ubuntu-18) -- name: Install Node.js and npm (ubuntu-18 or not is_debuntu) +- name: Install Node.js and npm (ubuntu-18 or not debuntu) package: name: "{{ item }}" state: latest - when: internet_available and (is_ubuntu_18 or (not is_debuntu)) + when: internet_available and (is_ubuntu_18 or not is_debuntu) with_items: - nodejs - npm @@ -152,7 +152,7 @@ enabled: yes state: restarted with_items: -# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot does usually does! (Is a daemon-reload or some such nec?) +# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot usually does! (Is a daemon-reload or some such nec?) - { name: sugarizer } when: sugarizer_enabled From 0a1897a4559f3bcd0a587804de5a91f098909dde Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 12:25:58 -0400 Subject: [PATCH 06/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 2edffb9bd..c33ba9152 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -31,7 +31,7 @@ # Going forward let's "git clone" IIAB's preferred versions, of sugarizer # AND sugarizer-server, as specified in roles/sugarizer/defaults/main.yml -# 2018-07-14 BLOWBACK: git works well BUT even with "depth: 1" +# 2018-07-14 BLOAT: git works well BUT even with "depth: 1" # - 229MB is unfort downloaded to /opt/iiab/sugarizer/.git # - 1.4MB is unfort downloaded to /opt/iiab/sugarizer-server/.git From a177edbafdd90c80728f7330b1f014f01d8567af Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 12:39:43 -0400 Subject: [PATCH 07/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index c33ba9152..bde050ada 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -44,7 +44,7 @@ depth: 1 when: internet_available -- name: Create symbolic link /opt/iiab/sugarizer-server -> /opt/iiab/{ sugarizer_server_version }} +- name: Create symbolic link /opt/iiab/sugarizer-server -> /opt/iiab/{{ sugarizer_server_version }} file: src: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" dest: "{{ sugarizer_location }}/sugarizer-server" From febd64207daa33a425bbe5cbb65a4f14dfc1526f Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 13:28:39 -0400 Subject: [PATCH 08/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index bde050ada..b4cba0abf 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -52,10 +52,6 @@ # 3. INSTALL A GOOD VERSION OF Node.js AND npm -# Raspbian & Debian 9 STILL need this nodesource.com approach (July 2018) to get a recent version of npm. -# As documented at https://github.com/iiab/iiab/issues/798#issuecomment-404324530 -# This nodesource.com approach (brings in npm 5.6.0 with nodejs 8.11.3) -# would also work on Ubuntu 18.04, but U18's apt brings in npm 3.5.2, which is sufficient (SO FAR!?) - name: Set up Node.js 8.x apt sources (debuntu, but avoid ubuntu-18) shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - when: internet_available and is_debuntu and not is_ubuntu_18 @@ -68,7 +64,23 @@ # state: present when: internet_available and is_debuntu and not is_ubuntu_18 -#- name: Install Node.js and npm (ubuntu-18) +# 2018-07-14: Raspbian (apt offers npm 1.4.21) & Debian 9 (apt offers no npm!) +# STILL NEED the above nodesource.com approach to get a version of npm that +# works with Sugarizer, as documented at: +# https://github.com/iiab/iiab/issues/798#issuecomment-404324530 + +# FYI this nodesource.com approach (brings in npm 5.6.0 with nodejs 8.11.3 +# for now) would also work on Ubuntu 18.04, and might even bring about a +# more sane consistency between mainline OS's? +# +# But For Now: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2, +# which appears suffic "SO FAR"? 18.04's nodejs 8.10.0 is more reassuring! + +# Crazy Aside: some versions of npm can upgrade themselves to the latest +# (6.1.0 for now) using command "npm install -g npm", but careful as it +# ends up in /usr/local/bin causing future/pkg management issues: +# https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation + - name: Install Node.js and npm (ubuntu-18 or not debuntu) package: name: "{{ item }}" @@ -78,15 +90,6 @@ - nodejs - npm -#- name: Install npm (OS's other than debuntu) -# package: -# name: "{{ item }}" -# state: present -# when: internet_available and not is_debuntu -# with_items: -# - nodejs -# - npm - # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules # Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's. From 5cc6072824fc5df65f80cdea9de4ab8694e52800 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 13:38:06 -0400 Subject: [PATCH 09/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index b4cba0abf..64f9d9b89 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -6,7 +6,7 @@ # 1. DOWNLOAD /opt/iiab/sugarizer -- name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab +- name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab (CAN TAKE SEVERAL MINUTES) git: repo: https://github.com/llaske/sugarizer dest: "{{ sugarizer_location }}/{{ sugarizer_version }}" From 14efa35628218a5ec26f477a63fc0a037a411a0d Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 13:46:38 -0400 Subject: [PATCH 10/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 64f9d9b89..87171e88e 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -161,11 +161,9 @@ - name: Disable service (all OS's) service: - name: "{{ item.name }}" + name: sugarizer enabled: no state: stopped - with_items: - - { name: sugarizer } when: not sugarizer_enabled - name: Add 'sugarizer' to list of services at /etc/iiab/iiab.ini From 41b8cb3b61d62c9ed93a4bca5ca05266a11173d5 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 14:01:20 -0400 Subject: [PATCH 11/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 87171e88e..9f98df0a4 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -35,6 +35,9 @@ # - 229MB is unfort downloaded to /opt/iiab/sugarizer/.git # - 1.4MB is unfort downloaded to /opt/iiab/sugarizer-server/.git +# CLARIF: during repeat runs of "./runrole sugarizer", this git sync shows +# "changed" (whereas above git sync shows "ok"). Reason: "npm install" +# (below) modifies /opt/iiab/sugarizer-server/node_modules - name: Clone llaske/sugarizer-server ({{ sugarizer_server_git_version }}) from GitHub to /opt/iiab git: repo: https://github.com/llaske/sugarizer-server @@ -76,9 +79,10 @@ # But For Now: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2, # which appears suffic "SO FAR"? 18.04's nodejs 8.10.0 is more reassuring! -# Crazy Aside: some versions of npm can upgrade themselves to the latest -# (6.1.0 for now) using command "npm install -g npm", but careful as it -# ends up in /usr/local/bin causing future/pkg management issues: +# CRAZY IDEA: some versions of npm can upgrade themselves to the latest +# (6.1.0 for now) with command "npm install -g npm" if that helps us in +# future, if that helps TK's memory issue etc? If so, be CAREFUL this +# may put npm in /usr/local/bin causing future/pkg management issues: # https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation - name: Install Node.js and npm (ubuntu-18 or not debuntu) From e352cd54f7aa8529fa6db1893f34bbbdb4386088 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 14:16:44 -0400 Subject: [PATCH 12/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 9f98df0a4..e55df129f 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -67,22 +67,22 @@ # state: present when: internet_available and is_debuntu and not is_ubuntu_18 -# 2018-07-14: Raspbian (apt offers npm 1.4.21) & Debian 9 (apt offers no npm!) -# STILL NEED the above nodesource.com approach to get a version of npm that -# works with Sugarizer, as documented at: +# 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 +# nodesource.com approach to get a version of npm that works with Sugarizer: # https://github.com/iiab/iiab/issues/798#issuecomment-404324530 - -# FYI this nodesource.com approach (brings in npm 5.6.0 with nodejs 8.11.3 -# for now) would also work on Ubuntu 18.04, and might even bring about a -# more sane consistency between mainline OS's? -# -# But For Now: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2, +# +# MORE POSITIVELY: this nodesource.com approach (brings in npm 5.6.0 with +# nodejs 8.11.3 for now, to any OS) would also work on Ubuntu 18.04, and +# might even bring about a sane consistency across mainline OS's? +# +# BUT FOR NOW: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2, # which appears suffic "SO FAR"? 18.04's nodejs 8.10.0 is more reassuring! # CRAZY IDEA: some versions of npm can upgrade themselves to the latest -# (6.1.0 for now) with command "npm install -g npm" if that helps us in -# future, if that helps TK's memory issue etc? If so, be CAREFUL this -# may put npm in /usr/local/bin causing future/pkg management issues: +# (6.1.0 for now) using command "npm install -g npm", if that helps us in +# future, e.g. TK's memory issue etc? If so, be CAREFUL this might put +# npm in /usr/local/bin causing future/pkg management issues: # https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation - name: Install Node.js and npm (ubuntu-18 or not debuntu) From c0317a885b085764b0188e87f3c0af2568104f21 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 14:25:12 -0400 Subject: [PATCH 13/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index e55df129f..12e8f6b14 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -121,15 +121,16 @@ command: npm install # slightly safer than "shell:" args: chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" -# creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" # OLD WAY 2 -# when: git_sug_server_output.changed # OLD WAY 3 -# when: not is_F18 and not node_modules_exists # OLD WAY 1 + #creates: "{{ sugarizer_location }}/{{ sugarizer_server_version }}/node_modules" # OLD WAY 2 + when: internet_available # "npm install" generally requires Internet access +# when: internet_available and git_sug_server_output.changed # OLD WAY 3 +# when: internet_available and not is_F18 and not node_modules_exists # OLD WAY 1 #- name: Create the express framework for Node.js (Fedora 18) # shell: npm install # args: # chdir: "{{ sugarizer_location }}/sugarizer/server" -# when: is_F18 and not node_modules_exists +# when: internet_available and is_F18 and not node_modules_exists # 5. PLACE CONFIG FILES @@ -141,9 +142,9 @@ owner: root group: root with_items: - - { src: 'sugarizer.service.j2', dest: '/etc/systemd/system/sugarizer.service', mode: '0644' } - { src: 'sugarizer.ini', dest: '{{ sugarizer_location }}/{{ sugarizer_server_version }}/env/sugarizer.ini', mode: '0644' } - { src: 'sugarizer.conf', dest: '/etc/apache2/sites-available', mode: '0644' } + - { src: 'sugarizer.service.j2', dest: '/etc/systemd/system/sugarizer.service', mode: '0644' } - name: Create symlink for short URL http://box/sugarizer file: From 16cce1eb4ab3c1be13d4bd86d87260789026de83 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 16:10:13 -0400 Subject: [PATCH 14/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 12e8f6b14..48d2c5fa4 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -79,10 +79,11 @@ # BUT FOR NOW: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2, # which appears suffic "SO FAR"? 18.04's nodejs 8.10.0 is more reassuring! -# CRAZY IDEA: some versions of npm can upgrade themselves to the latest -# (6.1.0 for now) using command "npm install -g npm", if that helps us in -# future, e.g. TK's memory issue etc? If so, be CAREFUL this might put -# npm in /usr/local/bin causing future/pkg management issues: +# CRAZY IDEA: most versions of npm can upgrade themselves to the latest +# (6.2.0 for now) using command "npm install -g npm", if that helps us in +# future, e.g. TK's memory issue etc? If so, be CAREFUL this puts npm +# in /usr/local/bin on Ubuntu 18.04 -- unlike Ubuntu 16.04 and Raspbian +# 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 Node.js and npm (ubuntu-18 or not debuntu) From 72d3b792f584b81cc20c8532eb47db3d28db4993 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 14 Jul 2018 16:14:06 -0400 Subject: [PATCH 15/15] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 48d2c5fa4..11f4aaef0 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -161,7 +161,7 @@ enabled: yes state: restarted with_items: -# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot usually does! (Is a daemon-reload or some such nec?) +# - { name: mongodb } # 2018-07-14: NICE TRY, but still doesn't bring http://box:8089 to life reliably, as a reboot usually does! (Is a "systemctl daemon-reload" or some such nec?) - { name: sugarizer } when: sugarizer_enabled