Removed nodejs role. Using apt now.
authorLuke Hoersten <luke@hoersten.org>
Thu, 22 Feb 2018 21:08:27 -0600
changeset 15 6913019b9492
parent 14 1d79e73c881f
child 16 23b704e271bb
Removed nodejs role. Using apt now.
roles/hap-nodejs/defaults/main.yaml
roles/hap-nodejs/meta/main.yaml
roles/hap-nodejs/tasks/main.yaml
roles/nodejs/tasks/main.yaml
--- a/roles/hap-nodejs/defaults/main.yaml	Tue Feb 20 20:17:53 2018 -0600
+++ b/roles/hap-nodejs/defaults/main.yaml	Thu Feb 22 21:08:27 2018 -0600
@@ -1,11 +1,5 @@
 ---
 
-hap_ubuntu_apt_packages:
-  - "libavahi-compat-libdnssd-dev"
-
-hap_npm_packages:
-  - "python-shell"
-
 hap_user: "hap-nodejs"
 hap_restart_sec: 10
 hap_dir: "/home/{{hap_user}}"
--- a/roles/hap-nodejs/meta/main.yaml	Tue Feb 20 20:17:53 2018 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
----
-
-dependencies:
-  - role: nodejs
--- a/roles/hap-nodejs/tasks/main.yaml	Tue Feb 20 20:17:53 2018 -0600
+++ b/roles/hap-nodejs/tasks/main.yaml	Thu Feb 22 21:08:27 2018 -0600
@@ -14,7 +14,10 @@
 - name: install homekit apt packages
   become: yes
   apt: name="{{item}}"
-  with_items: "{{hap_ubuntu_apt_packages}}"
+  with_items:
+    - "libavahi-compat-libdnssd-dev"
+    - "nodejs-legacy"
+    - "npm"
 
 - name: download and unarchive HAP-NodeJS
   become: yes
@@ -27,11 +30,13 @@
     owner: "{{hap_user}}"
     group: "{{hap_user}}"
 
+# global?
 - name: install npm packages
   become: yes
   become_user: "{{hap_user}}"
   npm: name="{{item}}" path="{{hap_dest}}"
-  with_items: "{{hap_npm_packages}}"
+  with_items:
+    - "python-shell"
 
 - name: clean up accessory examples
   become: yes
--- a/roles/nodejs/tasks/main.yaml	Tue Feb 20 20:17:53 2018 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
----
-
-# https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi
-
-- name: download and unarchive nodejs
-  become: yes
-  unarchive:
-    src: "https://nodejs.org/dist/v{{nodejs_version}}/{{nodejs_dir}}.tar.xz"
-    dest: "/opt/"
-    remote_src: yes
-    creates: "/opt/{{nodejs_dir}}"
-
-# sudo update-alternatives --install "/usr/bin/node" "node" "/opt/node/bin/node" 1
-- name: update node alterantives
-  become: yes
-  alternatives:
-    link: "/usr/bin/{{item}}"
-    name: "{{item}}"
-    path: "/opt/{{nodejs_dir}}/bin/{{item}}"
-    priority: "1"
-  with_items:
-    - "node"
-    - "npm"
-
-- name: npm install global deps
-  become: yes
-  npm: name="{{item}}" global="yes"
-  with_items:
-    - "npm"
-    - "node-gyp"
-
-- name: update node-gyp alterantives
-  become: yes
-  alternatives:
-    link: "/usr/bin/node-gyp"
-    name: "node-gyp"
-    path: "/opt/{{nodejs_dir}}/bin/node-gyp"
-    priority: "1"