Broke out separate hap-door role from hap-nodejs.
authorLuke Hoersten <luke@hoersten.org>
Thu, 01 Mar 2018 17:14:13 -0600
changeset 18 3044f32e7f74
parent 17 69a7d69de562
child 19 9091084884b0
Broke out separate hap-door role from hap-nodejs.
roles/hap-door/handlers/main.yaml
roles/hap-door/meta/main.yaml
roles/hap-door/tasks/main.yaml
roles/hap-nodejs/defaults/main.yaml
roles/hap-nodejs/tasks/main.yaml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/hap-door/handlers/main.yaml	Thu Mar 01 17:14:13 2018 -0600
@@ -0,0 +1,5 @@
+---
+
+- name: restart hap-nodejs service
+  systemd: name="hap-nodejs" state="restarted" daemon_reload="yes"
+  become: yes
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/hap-door/meta/main.yaml	Thu Mar 01 17:14:13 2018 -0600
@@ -0,0 +1,5 @@
+---
+
+dependencies:
+  - hap-nodejs
+  - automationhat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/hap-door/tasks/main.yaml	Thu Mar 01 17:14:13 2018 -0600
@@ -0,0 +1,38 @@
+---
+
+- name: install python3 apt packages
+  become: yes
+  apt: name="python3"
+  notify: restart hap-nodejs service
+
+- name: install python-shell npm packages
+  become: yes
+  npm: name="python-shell" global="yes"
+  notify: restart hap-nodejs service
+
+- name: install door accessory
+  become: yes
+  copy:
+    src: "../../../src/Door_accessory.js"
+    dest: "{{hap_dest}}/accessories/Door_accessory.js"
+    owner: "{{hap_user}}"
+    group: "{{hap_user}}"
+  notify: restart hap-nodejs service
+
+- name: create python dir
+  become: yes
+  file:
+    path: "{{hap_dest}}/python"
+    state: "directory"
+    owner: "{{hap_user}}"
+    group: "{{hap_user}}"
+
+- name: install doord.py
+  become: yes
+  copy:
+    src: "../../../src/doord.py"
+    dest: "{{hap_dest}}/python/doord.py"
+    owner: "{{hap_user}}"
+    group: "{{hap_user}}"
+    mode: "0755"
+  notify: restart hap-nodejs service
--- a/roles/hap-nodejs/defaults/main.yaml	Thu Mar 01 17:04:29 2018 -0600
+++ b/roles/hap-nodejs/defaults/main.yaml	Thu Mar 01 17:14:13 2018 -0600
@@ -1,7 +1,6 @@
 ---
 
 hap_apt_packages:
-    - "python3"
     - "libavahi-compat-libdnssd-dev"
     - "nodejs-legacy"
     - "npm"
--- a/roles/hap-nodejs/tasks/main.yaml	Thu Mar 01 17:04:29 2018 -0600
+++ b/roles/hap-nodejs/tasks/main.yaml	Thu Mar 01 17:14:13 2018 -0600
@@ -29,43 +29,11 @@
     group: "{{hap_user}}"
   notify: restart hap-nodejs service
 
-- name: install python-shell npm packages
-  become: yes
-  npm: name="python-shell" global="yes"
-  notify: restart hap-nodejs service
-
 - name: remove example accessories
   become: yes
   file: path="{{hap_dest}}/accessories/{{item}}" state="absent"
   with_items: "{{hap_example_accessories}}"
 
-- name: install door accessory
-  become: yes
-  copy:
-    src: "../../../src/Door_accessory.js"
-    dest: "{{hap_dest}}/accessories/Door_accessory.js"
-    owner: "{{hap_user}}"
-    group: "{{hap_user}}"
-  notify: restart hap-nodejs service
-
-- name: create python dir
-  become: yes
-  file:
-    path: "{{hap_dest}}/python"
-    state: "directory"
-    owner: "{{hap_user}}"
-    group: "{{hap_user}}"
-
-- name: install doord.py
-  become: yes
-  copy:
-    src: "../../../src/doord.py"
-    dest: "{{hap_dest}}/python/doord.py"
-    owner: "{{hap_user}}"
-    group: "{{hap_user}}"
-    mode: "0755"
-  notify: restart hap-nodejs service
-
 - name: build HAP-NodeJS
   become: yes
   become_user: "{{hap_user}}"