From 2006cfedccacc18a70655257d9b2b867efe3810a Mon Sep 17 00:00:00 2001 From: cmacrae Date: Wed, 16 Dec 2015 17:46:23 +0000 Subject: [PATCH] Fixing an issue with the node binary path: 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 :) --- README.md | 2 ++ defaults/main.yml | 2 ++ tasks/main.yml | 7 +------ templates/rocketchat.service.j2 | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e1443d2..a82f251 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/defaults/main.yml b/defaults/main.yml index fe3cea7..54eb975 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 1e212df..560c659 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 }}" @@ -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" diff --git a/templates/rocketchat.service.j2 b/templates/rocketchat.service.j2 index 50e1717..e6d8139 100644 --- a/templates/rocketchat.service.j2 +++ b/templates/rocketchat.service.j2 @@ -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