author | Luke Hoersten <luke@hoersten.org> |
Mon, 29 Jan 2018 23:19:00 -0600 | |
changeset 8 | e7007d23a144 |
parent 7 | 55b8db128364 |
child 9 | 511e97bd5566 |
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 |
with_items: "{{hap_ubuntu_apt_packages}}" |
|
18 |
||
19 |
- name: download and unarchive HAP-NodeJS |
|
8 | 20 |
become: yes |
21 |
become_user: "{{hap_user}}" |
|
22 |
unarchive: |
|
23 |
src: "{{hap_src}}" |
|
24 |
dest: "{{hap_dir}}" |
|
25 |
remote_src: "yes" |
|
26 |
creates: "{{hap_dest}}" |
|
27 |
owner: "{{hap_user}}" |
|
28 |
group: "{{hap_user}}" |
|
0 | 29 |
|
30 |
- name: install npm packages |
|
8 | 31 |
become: yes |
32 |
become_user: "{{hap_user}}" |
|
0 | 33 |
npm: name="{{item}}" path="{{hap_dest}}" |
34 |
with_items: "{{hap_npm_packages}}" |
|
35 |
||
36 |
- name: clean up accessory examples |
|
8 | 37 |
become: yes |
0 | 38 |
file: path="{{hap_dest}}/accessories" state="absent" |
39 |
||
40 |
- name: create accessories dir |
|
8 | 41 |
become: yes |
42 |
file: |
|
43 |
path: "{{hap_dest}}/accessories" |
|
44 |
state: "directory" |
|
45 |
owner: "{{hap_user}}" |
|
46 |
group: "{{hap_user}}" |
|
0 | 47 |
|
48 |
- name: create python dir |
|
8 | 49 |
become: yes |
50 |
file: |
|
51 |
path: "{{hap_dest}}/python" |
|
52 |
state: "directory" |
|
53 |
owner: "{{hap_user}}" |
|
54 |
group: "{{hap_user}}" |
|
0 | 55 |
|
56 |
- name: install doord.py |
|
8 | 57 |
become: yes |
58 |
copy: |
|
59 |
src: "../../../src/doord.py" |
|
60 |
dest: "{{hap_dest}}/python/doord.py" |
|
61 |
owner: "{{hap_user}}" |
|
62 |
group: "{{hap_user}}" |
|
63 |
mode: "0755" |
|
0 | 64 |
notify: restart hap-nodejs service |
65 |
||
66 |
- name: install door accessory |
|
8 | 67 |
become: yes |
68 |
copy: |
|
69 |
src: "../../../src/Door_accessory.js" |
|
70 |
dest: "{{hap_dest}}/accessories/Door_accessory.js" |
|
71 |
owner: "{{hap_user}}" |
|
72 |
group: "{{hap_user}}" |
|
0 | 73 |
notify: restart hap-nodejs service |
74 |
||
75 |
- name: build HAP-NodeJS |
|
8 | 76 |
become: yes |
77 |
become_user: "{{hap_user}}" |
|
7
55b8db128364
Removed unneeded npm command module.
Luke Hoersten <luke@hoersten.org>
parents:
1
diff
changeset
|
78 |
npm: path="{{hap_dest}}" |
0 | 79 |
|
80 |
- name: configure systemd service |
|
81 |
become: yes |
|
82 |
template: src="hap-nodejs.service.j2" dest="/lib/systemd/system/hap-nodejs.service" |
|
83 |
notify: restart hap-nodejs service |
|
84 |
||
85 |
- name: ensure hap-nodejs is started |
|
86 |
become: yes |
|
87 |
systemd: name="hap-nodejs.service" enabled="yes" state="started" |