1 --- |
1 --- |
2 |
2 |
3 - name: create homebridge user |
3 - name: add homebridge apt key |
4 become: yes |
4 become: yes |
5 user: |
5 get_url: |
6 name: "{{homebridge_user}}" |
6 url: "https://repo.homebridge.io/KEY.gpg" |
7 comment: "Homebridge" |
7 dest: /etc/apt/trusted.gpg.d/homebridge.asc |
8 shell: "/bin/false" |
8 mode: "0644" |
9 home: "{{homebridge_dir}}" |
9 |
10 groups: "{{homebridge_groups}}" |
10 - name: add homebridge apt repo |
11 append: yes |
11 become: yes |
12 move_home: yes |
12 apt_repository: repo="deb https://repo.homebridge.io stable main" |
|
13 |
|
14 - name: apt install homebridge |
|
15 become: yes |
|
16 apt: name="homebridge" |
13 notify: restart homebridge service |
17 notify: restart homebridge service |
14 |
|
15 - name: create homebridge directory |
|
16 become: yes |
|
17 file: |
|
18 path: "{{homebridge_dir}}" |
|
19 state: "directory" |
|
20 owner: "{{homebridge_user}}" |
|
21 group: "{{homebridge_user}}" |
|
22 mode: "0755" |
|
23 |
18 |
24 - name: install homebridge apt deps |
19 - name: install homebridge apt deps |
25 become: yes |
20 become: yes |
26 apt: name="{{homebridge_apt_packages}}" |
21 apt: name="{{homebridge_apt_packages}}" |
27 |
|
28 - name: install homebridge |
|
29 become: yes |
|
30 npm: name="homebridge" global="yes" |
|
31 notify: restart homebridge service |
22 notify: restart homebridge service |
32 |
23 |
33 - name: install platform accessories |
24 # - name: install platform accessories |
34 become: yes |
25 # become: yes |
35 npm: name="{{item}}" global="yes" |
26 # npm: name="{{item}}" global="yes" |
36 loop: "{{homebridge_npm_packages}}" |
27 # loop: "{{homebridge_npm_packages}}" |
37 notify: restart homebridge service |
28 # notify: restart homebridge service |
38 |
29 |
39 - name: configure homebridge |
30 # - name: configure homebridge |
40 become: yes |
31 # become: yes |
41 template: |
32 # template: |
42 src: "{{homebridge_config_template}}" |
33 # src: "{{homebridge_config_template}}" |
43 dest: "{{homebridge_dir}}/config.json" |
34 # dest: "{{homebridge_dir}}/config.json" |
44 notify: restart homebridge service |
35 # notify: restart homebridge service |
45 |
|
46 - name: configure systemd service |
|
47 become: yes |
|
48 template: |
|
49 src: "homebridge.service.j2" |
|
50 dest: "/lib/systemd/system/homebridge.service" |
|
51 notify: restart homebridge service |
|
52 |
36 |
53 - name: ensure homebridge is started |
37 - name: ensure homebridge is started |
54 become: yes |
38 become: yes |
55 systemd: name="homebridge.service" enabled="yes" state="started" |
39 systemd: name="homebridge.service" enabled="yes" state="started" |