1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Merge pull request #2613 from holta/mongodb_port

Change mongodb_port from 27018 to more standard 27017, following Sugarizer Server's lead
This commit is contained in:
A Holt 2020-11-03 16:30:24 -05:00 committed by GitHub
commit 37df52ab5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 13 deletions

View file

@ -15,7 +15,7 @@
# mongodb_enabled: False # mongodb_enabled: False
# mongodb_port: 27018 # mongodb_port: 27017
# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml # All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing! # If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!

View file

@ -114,12 +114,12 @@
- mongodb-org-server - mongodb-org-server
state: present state: present
- name: Change {{ mongodb_conf }} port to {{ mongodb_port }} -- takes effect on next (re)start of the service -- via enable-or-disable.yml or via sugarizer.service auto-starting MongoDB on demand - name: Establish {{ mongodb_conf }} port {{ mongodb_port }} (mongodb_conf) -- takes effect on next (re)start of the service -- via enable-or-disable.yml or via sugarizer.service auto-starting MongoDB on demand
lineinfile: lineinfile:
path: "{{ mongodb_conf }}" path: "{{ mongodb_conf }}"
regexp: "port: 27017" regexp: '^\s*port:' # \s = any whitespace char. stackoverflow.com/a/38491899
backrefs: yes #backrefs: yes
line: " port: {{ mongodb_port }}" # 27018 line: " port: {{ mongodb_port }}" # 27017
# end block # end block
when: (ansible_architecture == "aarch64") or (ansible_architecture == "x86_64") when: (ansible_architecture == "aarch64") or (ansible_architecture == "x86_64")

View file

@ -5,7 +5,12 @@
# Comma separated list of ip addresses to listen on (all local ips by default) # Comma separated list of ip addresses to listen on (all local ips by default)
bind_ip = 127.0.0.1 bind_ip = 127.0.0.1
# Specify port number (27017 by default...but typically 27018 for IIAB) # mongodb_port is set to 27017 in /opt/iiab/iiab/vars/default_vars.yml
# If you must change this, it's best to edit /etc/iiab/local_vars.yml prior to
# installing IIAB. Please also see upstream recommendations:
# https://github.com/llaske/sugarizer-server/blob/master/env/sugarizer.ini line ~22 under [database]
# https://docs.mongodb.com/manual/reference/default-mongodb-port/
# https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt
port = {{ mongodb_port }} port = {{ mongodb_port }}
# Fork server process (false by default) # Fork server process (false by default)

View file

@ -176,7 +176,7 @@
- name: Set Sugarizer port to {{ sugarizer_port }} in /opt/iiab/sugarizer-server/env/sugarizer.ini - name: Set Sugarizer port to {{ sugarizer_port }} in /opt/iiab/sugarizer-server/env/sugarizer.ini
lineinfile: lineinfile:
path: "{{ iiab_base }}/sugarizer-server/env/sugarizer.ini" path: "{{ iiab_base }}/sugarizer-server/env/sugarizer.ini"
regexp: "^port = 8080$" regexp: '^port = 8080$'
line: "port = {{ sugarizer_port }}" line: "port = {{ sugarizer_port }}"
# 2019-02-02 No Longer Required thanks to @llaske's upstream fix: # 2019-02-02 No Longer Required thanks to @llaske's upstream fix:
@ -193,15 +193,19 @@
#- name: Set MongoDB "server" from localhost to 127.0.0.1 in /opt/iiab/sugarizer-server/env/sugarizer.ini #- name: Set MongoDB "server" from localhost to 127.0.0.1 in /opt/iiab/sugarizer-server/env/sugarizer.ini
# lineinfile: # lineinfile:
# path: "{{ iiab_base }}/sugarizer-server/env/sugarizer.ini" # path: "{{ iiab_base }}/sugarizer-server/env/sugarizer.ini"
# regexp: "^server = localhost$" # regexp: '^server = localhost$'
# line: "server = 127.0.0.1" # line: "server = 127.0.0.1"
# mongodb_port is set to 27018 in /opt/iiab/iiab/vars/default_vars.yml # mongodb_port is set to 27017 in /opt/iiab/iiab/vars/default_vars.yml
# If you need to change this, edit /etc/iiab/local_vars.yml prior to installing # If you must change this, it's best to edit /etc/iiab/local_vars.yml prior to
# installing IIAB. Please also see upstream recommendations:
# https://github.com/llaske/sugarizer-server/blob/master/env/sugarizer.ini line ~22 under [database]
# https://docs.mongodb.com/manual/reference/default-mongodb-port/
# https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt
- name: Set MongoDB port to {{ mongodb_port }} in /opt/iiab/sugarizer-server/env/sugarizer.ini - name: Set MongoDB port to {{ mongodb_port }} in /opt/iiab/sugarizer-server/env/sugarizer.ini
lineinfile: lineinfile:
path: "{{ iiab_base }}/sugarizer-server/env/sugarizer.ini" path: "{{ iiab_base }}/sugarizer-server/env/sugarizer.ini"
regexp: "^port = 27017$" regexp: '^port = 27017$' # Careful as file also contains 2 other ports!
line: "port = {{ mongodb_port }}" line: "port = {{ mongodb_port }}"
# 2-LINE FIX FOR sugarizer.js BY @georgejhunt FOR http://box/sugarizer # 2-LINE FIX FOR sugarizer.js BY @georgejhunt FOR http://box/sugarizer
@ -211,7 +215,7 @@
- name: For http://box/sugarizer -- add pathPrefix lines in /opt/iiab/sugarizer-server/sugarizer.js - name: For http://box/sugarizer -- add pathPrefix lines in /opt/iiab/sugarizer-server/sugarizer.js
lineinfile: lineinfile:
path: "{{ iiab_base }}/sugarizer-server/sugarizer.js" path: "{{ iiab_base }}/sugarizer-server/sugarizer.js"
regexp: "AUTO-INSERTED BY IIAB" # avoids inserting it twice! regexp: 'AUTO-INSERTED BY IIAB' # avoids inserting it twice!
insertbefore: "// Start listening$" 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) 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 // AUTO-INSERTED BY IIAB FOR http://box/sugarizer

View file

@ -485,7 +485,7 @@ mongodb_install: False
# misleading as Sugarizer starts mongodb's systemd service on its own, due to # misleading as Sugarizer starts mongodb's systemd service on its own, due to
# 'Requires=mongodb.service' within /etc/systemd/system/sugarizer.service # 'Requires=mongodb.service' within /etc/systemd/system/sugarizer.service
mongodb_enabled: False mongodb_enabled: False
mongodb_port: 27018 mongodb_port: 27017
# roles/sugarizer/meta/main.yml auto-invokes 2 above prereqs: mongodb & nodejs # roles/sugarizer/meta/main.yml auto-invokes 2 above prereqs: mongodb & nodejs
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879