Skip to content

Commit

Permalink
Fixing an issue with the node binary path:
Browse files Browse the repository at this point in the history
PATH evaluation was causing the wrong node binary to be used when
launching Rocket.Chat on EL systems... something that remained hidden to
me because of my dev environment.

Thanks to @jeansnkicks for helping me track this down :)
  • Loading branch information
cmacrae committed Dec 16, 2015
1 parent a122d94 commit 2006cfe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ All variables have sane defaults set in [`defaults/main.yml`](defaults/main.yml)
| `rocket_chat_version` | `master` | The version of Rocket.Chat to deploy; should be `master` for stable, or `develop` for development releases |
| `rocket_chat_tarball_remote` | See [`defaults/main.yml`](defaults/main.yml) | The remote URL to fetch the Rocket.Chat tarball from (uses `rocket_chat_version`) |
| `rocket_chat_tarball_sha256sum` | See [`defaults/main.yml`](defaults/main.yml) | The SHA256 hash sum of the Rocket.Chat tarball being fetched |
| `rocket_chat_tarball_fetch_timeout` | 100 | The time (in seconds) before the attempt to fetch the Rocket.Chat tarball fails |
| `rocket_chat_service_user` | `rocketchat` | The name of the user that will run the Rocket.Chat server process |
| `rocket_chat_service_group` | `rocketchat` | The name of the primary group for the `rocket_chat_service_user` user |
| `rocket_chat_service_host` | `"{{ ansible_fqdn }}"` | The FQDN of the Rocket.Chat system |
| `rocket_chat_service_port` | 3000 | The TCP port Rocket.Chat listens on |
| `rocket_chat_nave_node_path` | `/usr/local/bin/nave` | The path to the `node` binary installed by Nave, which is then used to launch Rocket.Chat |
| `rocket_chat_include_mongodb` | True | A boolean value that determines whether or not to deploy MongoDB |
| `rocket_chat_mongodb_server` | 127.0.0.1 | The IP/FQDN of the MongoDB host |
| `rocket_chat_mongodb_port` | 27017 | The TCP port to contact the MongoDB host host via |
Expand Down
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ rocket_chat_application_path: /var/lib/rocket.chat
rocket_chat_version: master
rocket_chat_tarball_remote: https://s3.amazonaws.com/rocketchatbuild/rocket.chat-{{ rocket_chat_version }}.tgz
rocket_chat_tarball_sha256sum: 26da9ffca8afdaa2d09faf673683e0ab558f39907fb95aa4f5631a9f40bda707
rocket_chat_tarball_fetch_timeout: 100
rocket_chat_service_user: rocketchat
rocket_chat_service_group: rocketchat
rocket_chat_service_host: "{{ ansible_fqdn }}"
rocket_chat_service_port: 3000
rocket_chat_nave_node_path: /usr/local/bin/node

# MongoDB settings
rocket_chat_mongodb_packages: mongodb
Expand Down
7 changes: 1 addition & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
url: "{{ rocket_chat_tarball_remote }}"
sha256sum: "{{ rocket_chat_tarball_sha256sum }}"
dest: "{{ rocket_chat_application_path }}"
timeout: "{{ rocket_chat_tarball_fetch_timeout }}"
become: True
become_user: "{{ rocket_chat_service_user }}"

Expand Down Expand Up @@ -131,12 +132,6 @@
recurse: True
tags: build

- name: Register the 'node' binary path
command: which node
changed_when: False
register: node_path
tags: service

- include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml"
Expand Down
2 changes: 1 addition & 1 deletion templates/rocketchat.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Environment=MONGO_OPLOG_URL=mongodb://{{ rocket_chat_mongodb_server }}:{{ rocket
Environment=ROOT_URL=http://{{ rocket_chat_service_host }}
Environment=PORT={{ rocket_chat_service_port }}
WorkingDirectory={{ rocket_chat_application_path }}
ExecStart={{ node_path.stdout }} {{ rocket_chat_application_path }}/bundle/main.js
ExecStart={{ rocket_chat_nave_node_path }} {{ rocket_chat_application_path }}/bundle/main.js

[Install]
WantedBy=multi-user.target

0 comments on commit 2006cfe

Please sign in to comment.