diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 06c250340..301e647e7 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -157,36 +157,43 @@ #- { src: 'sugarizer.ini.j2', dest: '{{ sugarizer_location }}/sugarizer-server/env/sugarizer.ini' } #- { src: 'sugarizer.js', dest: '{{ sugarizer_location }}/sugarizer-server' } +# sugarizer_port is set to 8089 in /opt/iiab/iiab/vars/default_vars.yml +# If you need to change this, edit /etc/iiab/local_vars.yml prior to installing # SEE https://github.com/iiab/iiab/pull/1430#issuecomment-459129378 - name: Set Sugarizer port to {{ sugarizer_port }} in /opt/iiab/sugarizer-server/env/sugarizer.ini lineinfile: path: /opt/iiab/sugarizer-server/env/sugarizer.ini regexp: "^port = 8080$" line: "port = {{ sugarizer_port }}" -# sugarizer_port is set to 8089 in /opt/iiab/iiab/vars/default_vars.yml -# If you need to change this, edit /etc/iiab/local_vars.yml prior to installing +# mongodb_port is set to 27018 in /opt/iiab/iiab/vars/default_vars.yml +# If you need to change this, edit /etc/iiab/local_vars.yml prior to installing # SEE https://github.com/iiab/iiab/pull/1430#issuecomment-459129378 - name: Set MongoDB port to {{ mongodb_port }} in /opt/iiab/sugarizer-server/env/sugarizer.ini lineinfile: path: /opt/iiab/sugarizer-server/env/sugarizer.ini regexp: "^port = 27017$" line: "port = {{ mongodb_port }}" -# mongodb_port is set to 27018 in /opt/iiab/iiab/vars/default_vars.yml -# If you need to change this, edit /etc/iiab/local_vars.yml prior to installing +# 2-LINE FIX FOR sugarizer.js BY @georgejhunt FOR http://box/sugarizer # SEE https://github.com/iiab/iiab/pull/1430#issuecomment-459129378 -- name: Customize pathPrefix /sugarizer in /opt/iiab/sugarizer-server/sugarizer.js - lineinfile: - path: /opt/iiab/sugarizer-server/sugarizer.js - regexp: "AUTO-INSERTED BY IIAB" # avoids inserting it twice! - insertbefore: "// Start listening$" - line: | # SEE https://yaml-multiline.info (use |+ to 'keep' newlines at end...though |8 and |+4 "indentation indicators" don't work with Ansible) - // AUTO-INSERTED BY IIAB FOR http://box/sugarizer - var pathPrefix = '/sugarizer'; - app.use(pathPrefix, require('path-prefix-proxy')(pathPrefix)); - # Use this instead, if tabs are truly nec: - # line: "\t// AUTO-INSERTED BY IIAB FOR http://box/sugarizer\n\tvar pathPrefix = '/sugarizer';\n\tapp.use(pathPrefix, require('path-prefix-proxy')(pathPrefix));\n" +# +# 2019-02-02: USED TO WORK ON Node.js 8.x BUT SUGARIZER NO LONGER STARTS ON Node.js 10.x +# As tested w/ MongoDB 3.0.14 (binaries) on RPi and MongoDB 3.6.3 (apt) on Ubuntu 18.04 +# Errors are: "status=255" within "systemctl status sugarizer" +# "Cannot find module 'path-prefix-proxy'" within "journalctl -eu sugarizer" +# +#- name: Customize pathPrefix /sugarizer in /opt/iiab/sugarizer-server/sugarizer.js +# lineinfile: +# path: /opt/iiab/sugarizer-server/sugarizer.js +# regexp: "AUTO-INSERTED BY IIAB" # avoids inserting it twice! +# insertbefore: "// Start listening$" +# line: | # SEE https://yaml-multiline.info (use |+ to 'keep' newlines at end...though |8 and |+4 "indentation indicators" don't work with Ansible) +# // AUTO-INSERTED BY IIAB FOR http://box/sugarizer +# var pathPrefix = '/sugarizer'; +# app.use(pathPrefix, require('path-prefix-proxy')(pathPrefix)); +# # Use this instead, if tabs are truly nec: +# # line: "\t// AUTO-INSERTED BY IIAB FOR http://box/sugarizer\n\tvar pathPrefix = '/sugarizer';\n\tapp.use(pathPrefix, require('path-prefix-proxy')(pathPrefix));\n" # Ansible's blockinfile module: # - inserts a mandatory marker line at beginning AND end of the block...ok fine