Fix systemd launch of timesheetsdb
- Add default environment file with postgres config
- Add full path to npm (makes ubuntu happy)
- Call handlers appropriately when systemd unit files are modified
- Add very basic test
Change-Id: I5b1dfab78e449492be193bccfe470813f3028195
diff --git a/tasks/Debian.yml b/tasks/Debian.yml
index f3563ea..95366c6 100644
--- a/tasks/Debian.yml
+++ b/tasks/Debian.yml
@@ -13,6 +13,15 @@
update_cache: true
cache_valid_time: 3600
+- name: Create environment config for timesheetsdb service
+ template:
+ src: "default.timesheetsdb.j2"
+ dest: "/etc/default/timesheetsdb"
+ owner: "root"
+ group: "root"
+ mode: "0640"
+ notify:
+ - restart-timesheetsdb
- name: Create systemd service unit files for timesheetsdb service
template:
@@ -23,3 +32,6 @@
mode: "0644"
with_items:
- "timesheetsdb.service"
+ notify:
+ - start-timesheetsdb
+ - restart-timesheetsdb
diff --git a/tasks/main.yml b/tasks/main.yml
index 597d5f3..fc4d7ca 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -40,14 +40,6 @@
repo: "{{ timesheetsdb_repo }}"
dest: "{{ timesheets_dir }}/db"
version: "{{ timesheetsdb_version }}"
-
-- name: Create timesheetsdb configuration file
- template:
- src: "timesheetsdb_config.json.j2"
- dest: "{{ timesheets_dir }}/db/timesheetsdb_config.json"
- owner: "root"
- group: "{{ timesheets_groupname }}"
- mode: "0640"
notify:
- "restart-timesheetsdb"
@@ -59,7 +51,7 @@
cmd: "npm install"
creates: "{{ timesheets_dir }}/db/node_modules"
notify:
- - "start-timesheetsdb"
+ - "restart-timesheetsdb"
- name: Build timesheetsdb
become: true
@@ -69,7 +61,7 @@
cmd: "npm run build"
creates: "{{ timesheets_dir }}/db/dist"
notify:
- - "start-timesheetsdb"
+ - "restart-timesheetsdb"
- name: Create directory for timesheetsui
file: