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