author | Luke Hoersten <luke@hoersten.org> |
Thu, 01 Mar 2018 17:04:29 -0600 | |
changeset 17 | 69a7d69de562 |
parent 16 | 23b704e271bb |
child 18 | 3044f32e7f74 |
permissions | -rw-r--r-- |
0 | 1 |
--- |
2 |
||
8 | 3 |
- name: create hap-nodejs user |
4 |
become: yes |
|
5 |
user: |
|
6 |
name: "{{hap_user}}" |
|
7 |
comment: "HAP-NodeJS" |
|
8 |
groups: "spi,i2c,gpio" |
|
9 |
shell: "/bin/false" |
|
10 |
home: "{{hap_dir}}" |
|
11 |
move_home: yes |
|
12 |
notify: restart hap-nodejs service |
|
13 |
||
0 | 14 |
- name: install homekit apt packages |
15 |
become: yes |
|
16 |
apt: name="{{item}}" |
|
17
69a7d69de562
Move python3 to hap-nodejs role.
Luke Hoersten <luke@hoersten.org>
parents:
16
diff
changeset
|
17 |
with_items: "{{hap_apt_packages}}" |
16 | 18 |
notify: restart hap-nodejs service |
0 | 19 |
|
20 |
- name: download and unarchive HAP-NodeJS |
|
8 | 21 |
become: yes |
22 |
become_user: "{{hap_user}}" |
|
23 |
unarchive: |
|
24 |
src: "{{hap_src}}" |
|
25 |
dest: "{{hap_dir}}" |
|
26 |
remote_src: "yes" |
|
27 |
creates: "{{hap_dest}}" |
|
28 |
owner: "{{hap_user}}" |
|
29 |
group: "{{hap_user}}" |
|
16 | 30 |
notify: restart hap-nodejs service |
0 | 31 |
|
16 | 32 |
- name: install python-shell npm packages |
8 | 33 |
become: yes |
16 | 34 |
npm: name="python-shell" global="yes" |
35 |
notify: restart hap-nodejs service |
|
0 | 36 |
|
17
69a7d69de562
Move python3 to hap-nodejs role.
Luke Hoersten <luke@hoersten.org>
parents:
16
diff
changeset
|
37 |
- name: remove example accessories |
8 | 38 |
become: yes |
17
69a7d69de562
Move python3 to hap-nodejs role.
Luke Hoersten <luke@hoersten.org>
parents:
16
diff
changeset
|
39 |
file: path="{{hap_dest}}/accessories/{{item}}" state="absent" |
69a7d69de562
Move python3 to hap-nodejs role.
Luke Hoersten <luke@hoersten.org>
parents:
16
diff
changeset
|
40 |
with_items: "{{hap_example_accessories}}" |
9
511e97bd5566
Created custom automationhat role.
Luke Hoersten <luke@hoersten.org>
parents:
8
diff
changeset
|
41 |
|
511e97bd5566
Created custom automationhat role.
Luke Hoersten <luke@hoersten.org>
parents:
8
diff
changeset
|
42 |
- name: install door accessory |
511e97bd5566
Created custom automationhat role.
Luke Hoersten <luke@hoersten.org>
parents:
8
diff
changeset
|
43 |
become: yes |
511e97bd5566
Created custom automationhat role.
Luke Hoersten <luke@hoersten.org>
parents:
8
diff
changeset
|
44 |
copy: |
511e97bd5566
Created custom automationhat role.
Luke Hoersten <luke@hoersten.org>
parents:
8
diff
changeset
|
45 |
src: "../../../src/Door_accessory.js" |
511e97bd5566
Created custom automationhat role.
Luke Hoersten <luke@hoersten.org>
parents:
8
diff
changeset
|
46 |
dest: "{{hap_dest}}/accessories/Door_accessory.js" |
511e97bd5566
Created custom automationhat role.
Luke Hoersten <luke@hoersten.org>
parents:
8
diff
changeset
|
47 |
owner: "{{hap_user}}" |
511e97bd5566
Created custom automationhat role.
Luke Hoersten <luke@hoersten.org>
parents:
8
diff
changeset
|
48 |
group: "{{hap_user}}" |
511e97bd5566
Created custom automationhat role.
Luke Hoersten <luke@hoersten.org>
parents:
8
diff
changeset
|
49 |
notify: restart hap-nodejs service |
0 | 50 |
|
51 |
- name: create python dir |
|
8 | 52 |
become: yes |
53 |
file: |
|
54 |
path: "{{hap_dest}}/python" |
|
55 |
state: "directory" |
|
56 |
owner: "{{hap_user}}" |
|
57 |
group: "{{hap_user}}" |
|
0 | 58 |
|
59 |
- name: install doord.py |
|
8 | 60 |
become: yes |
61 |
copy: |
|
62 |
src: "../../../src/doord.py" |
|
63 |
dest: "{{hap_dest}}/python/doord.py" |
|
64 |
owner: "{{hap_user}}" |
|
65 |
group: "{{hap_user}}" |
|
66 |
mode: "0755" |
|
0 | 67 |
notify: restart hap-nodejs service |
68 |
||
69 |
- name: build HAP-NodeJS |
|
8 | 70 |
become: yes |
71 |
become_user: "{{hap_user}}" |
|
7
55b8db128364
Removed unneeded npm command module.
Luke Hoersten <luke@hoersten.org>
parents:
1
diff
changeset
|
72 |
npm: path="{{hap_dest}}" |
0 | 73 |
|
74 |
- name: configure systemd service |
|
75 |
become: yes |
|
76 |
template: src="hap-nodejs.service.j2" dest="/lib/systemd/system/hap-nodejs.service" |
|
77 |
notify: restart hap-nodejs service |
|
78 |
||
79 |
- name: ensure hap-nodejs is started |
|
80 |
become: yes |
|
81 |
systemd: name="hap-nodejs.service" enabled="yes" state="started" |