roles/homekit-door/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sun, 02 Aug 2020 15:02:37 -0500
changeset 28 f891e481f06d
parent 26 87ddaf81e63c
permissions -rw-r--r--
Updated canonical repo path.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
26
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
     3
- name: create homekit-door user
18
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
26
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
     5
  user:
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
     6
    name: "{{homekit_door_user}}"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
     7
    comment: "HomeKit Door"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
     8
    groups: "spi,i2c,gpio"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
     9
    shell: "/bin/false"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    10
    move_home: yes
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    11
  notify: restart homekit-door service
18
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
26
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    13
- name: install homekit-door apt packages
18
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
  become: yes
26
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    15
  apt: name="{{homekit_door_apt_packages}}"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    16
  notify: restart homekit-door service
18
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
26
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    18
- name: install homekit-door application dir
18
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
  become: yes
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
  copy:
26
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    21
    src: "../../../npmjs-package/"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    22
    dest: "{{homekit_door_dir}}/"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    23
    owner: "{{homekit_door_user}}"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    24
    group: "{{homekit_door_user}}"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    25
    mode: "0755"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    26
  notify: restart homekit-door service
18
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    27
26
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    28
- name: build homekit-door
18
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
  become: yes
26
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    30
  become_user: "{{homekit_door_user}}"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    31
  npm: path="{{homekit_door_dir}}"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    32
  notify: restart homekit-door service
18
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    33
26
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    34
- name: configure systemd service
18
3044f32e7f74 Broke out separate hap-door role from hap-nodejs.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    35
  become: yes
26
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    36
  template: src="homekit-door.service.j2" dest="/lib/systemd/system/homekit-door.service"
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    37
  notify: restart homekit-door service
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    38
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    39
- name: ensure homekit-door is started
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    40
  become: yes
87ddaf81e63c Updated homekit door for Raspbian Buster.
Luke Hoersten <luke@hoersten.org>
parents: 18
diff changeset
    41
  systemd: name="homekit-door.service" enabled="yes" state="started"