node/conf/tasks/main.yaml
changeset 0 474ccafc2349
child 2 0556e208fbee
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/node/conf/tasks/main.yaml	Mon Apr 27 11:17:52 2020 -0500
@@ -0,0 +1,36 @@
+---
+
+- name: create node data dir
+  become: yes
+  file:
+    path: "{{item}}"
+    state: "directory"
+    owner: "{{node_user}}"
+    group: "{{node_user}}"
+    mode: "0770"
+  with_items:
+    - "{{node_data_dir}}"
+    - "{{node_log_dir}}"
+    - "{{node_conf_dir}}"
+
+- name: install conf
+  become: yes
+  template:
+    src: "{{node_conf_template}}"
+    dest: "{{node_conf_dir}}/{{node_type}}.conf"
+    owner: "{{node_user}}"
+    group: "{{node_user}}"
+    mode: "0770"
+  notify: restart node
+
+- name: install node service
+  become: yes
+  template:
+    src: "{{node_service_template}}"
+    dest: "/lib/systemd/system/{{node_type}}.service"
+    mode: "0644"
+  notify: restart node
+
+- name: ensure node is started
+  become: yes
+  systemd: service="{{node_type}}.service" enabled="yes" state="started" daemon_reload="yes"