src.nth.io/

summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2018-03-01 17:14:13 -0600
committerLuke Hoersten <[email protected]>2018-03-01 17:14:13 -0600
commit7cad29ec72c8765cd439e12a251458a71629bc25 (patch)
tree1e1f3557cc51f1eaa740421c2c03498f97288deb /roles
parentd80ca142279de1c556e582c46c43b8bd20f25b49 (diff)
Broke out separate hap-door role from hap-nodejs.
Diffstat (limited to 'roles')
-rw-r--r--roles/hap-door/handlers/main.yaml5
-rw-r--r--roles/hap-door/meta/main.yaml5
-rw-r--r--roles/hap-door/tasks/main.yaml38
-rw-r--r--roles/hap-nodejs/defaults/main.yaml1
-rw-r--r--roles/hap-nodejs/tasks/main.yaml32
5 files changed, 48 insertions, 33 deletions
diff --git a/roles/hap-door/handlers/main.yaml b/roles/hap-door/handlers/main.yaml
new file mode 100644
index 0000000..25d24bd
--- /dev/null
+++ b/roles/hap-door/handlers/main.yaml
@@ -0,0 +1,5 @@
+---
+
+- name: restart hap-nodejs service
+ systemd: name="hap-nodejs" state="restarted" daemon_reload="yes"
+ become: yes
diff --git a/roles/hap-door/meta/main.yaml b/roles/hap-door/meta/main.yaml
new file mode 100644
index 0000000..8261e8f
--- /dev/null
+++ b/roles/hap-door/meta/main.yaml
@@ -0,0 +1,5 @@
+---
+
+dependencies:
+ - hap-nodejs
+ - automationhat
diff --git a/roles/hap-door/tasks/main.yaml b/roles/hap-door/tasks/main.yaml
new file mode 100644
index 0000000..7e1669f
--- /dev/null
+++ b/roles/hap-door/tasks/main.yaml
@@ -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
diff --git a/roles/hap-nodejs/defaults/main.yaml b/roles/hap-nodejs/defaults/main.yaml
index 830c032..7a2f140 100644
--- a/roles/hap-nodejs/defaults/main.yaml
+++ b/roles/hap-nodejs/defaults/main.yaml
@@ -1,7 +1,6 @@
---
hap_apt_packages:
- - "python3"
- "libavahi-compat-libdnssd-dev"
- "nodejs-legacy"
- "npm"
diff --git a/roles/hap-nodejs/tasks/main.yaml b/roles/hap-nodejs/tasks/main.yaml
index 50ee6ed..e56fae8 100644
--- a/roles/hap-nodejs/tasks/main.yaml
+++ b/roles/hap-nodejs/tasks/main.yaml
@@ -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}}"