roles/hap-nodejs/tasks/main.yaml
changeset 0 30d8bcb1ebb4
child 1 bc6a0f25a229
equal deleted inserted replaced
-1:000000000000 0:30d8bcb1ebb4
       
     1 ---
       
     2 
       
     3 - name: install homekit apt packages
       
     4   become: yes
       
     5   apt: name="{{item}}"
       
     6   with_items: "{{hap_ubuntu_apt_packages}}"
       
     7 
       
     8 - name: download and unarchive HAP-NodeJS
       
     9   unarchive: src="{{hap_src}}" dest="{{hap_home}}" remote_src="yes" creates="{{hap_dest}}"
       
    10 
       
    11 - name: install npm packages
       
    12   npm: name="{{item}}" path="{{hap_dest}}"
       
    13   with_items: "{{hap_npm_packages}}"
       
    14 
       
    15 - name: clean up accessory examples
       
    16   file: path="{{hap_dest}}/accessories" state="absent"
       
    17 
       
    18 - name: create accessories dir
       
    19   file: path="{{hap_dest}}/accessories" state="directory"
       
    20 
       
    21 - name: create python dir
       
    22   file: path="{{hap_dest}}/python" state="directory"
       
    23 
       
    24 - name: install doord.py
       
    25   copy: src="doord.py" dest="{{hap_dest}}/python/doord.py"
       
    26   notify: restart hap-nodejs service
       
    27 
       
    28 - name: install door accessory
       
    29   copy: src="Door_accessory.js" dest="{{hap_dest}}/accessories/Door_accessory.js"
       
    30   notify: restart hap-nodejs service
       
    31 
       
    32 - name: build HAP-NodeJS
       
    33   command: "npm install"
       
    34   args:
       
    35     chdir: "{{hap_dest}}"
       
    36   changed_when: false
       
    37 
       
    38 - name: configure systemd service
       
    39   become: yes
       
    40   template: src="hap-nodejs.service.j2" dest="/lib/systemd/system/hap-nodejs.service"
       
    41   notify: restart hap-nodejs service
       
    42 
       
    43 - name: ensure hap-nodejs is started
       
    44   become: yes
       
    45   systemd: name="hap-nodejs.service" enabled="yes" state="started"