author | Luke Hoersten <luke@hoersten.org> |
Thu, 01 Mar 2018 17:14:13 -0600 | |
changeset 18 | 3044f32e7f74 |
parent 17 | 69a7d69de562 |
child 25 | bc6c646f1814 |
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 |
|
17
69a7d69de562
Move python3 to hap-nodejs role.
Luke Hoersten <luke@hoersten.org>
parents:
16
diff
changeset
|
32 |
- name: remove example accessories |
8 | 33 |
become: yes |
17
69a7d69de562
Move python3 to hap-nodejs role.
Luke Hoersten <luke@hoersten.org>
parents:
16
diff
changeset
|
34 |
file: path="{{hap_dest}}/accessories/{{item}}" state="absent" |
69a7d69de562
Move python3 to hap-nodejs role.
Luke Hoersten <luke@hoersten.org>
parents:
16
diff
changeset
|
35 |
with_items: "{{hap_example_accessories}}" |
9
511e97bd5566
Created custom automationhat role.
Luke Hoersten <luke@hoersten.org>
parents:
8
diff
changeset
|
36 |
|
0 | 37 |
- name: build HAP-NodeJS |
8 | 38 |
become: yes |
39 |
become_user: "{{hap_user}}" |
|
7
55b8db128364
Removed unneeded npm command module.
Luke Hoersten <luke@hoersten.org>
parents:
1
diff
changeset
|
40 |
npm: path="{{hap_dest}}" |
0 | 41 |
|
42 |
- name: configure systemd service |
|
43 |
become: yes |
|
44 |
template: src="hap-nodejs.service.j2" dest="/lib/systemd/system/hap-nodejs.service" |
|
45 |
notify: restart hap-nodejs service |
|
46 |
||
47 |
- name: ensure hap-nodejs is started |
|
48 |
become: yes |
|
49 |
systemd: name="hap-nodejs.service" enabled="yes" state="started" |