mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Add nodered, mqtt port variables; nodered hash-password
This commit is contained in:
parent
e35013a179
commit
8cef26738a
2 changed files with 48 additions and 15 deletions
|
@ -2,3 +2,4 @@ mosquitto_install: True
|
||||||
mosquitto_enabled: False
|
mosquitto_enabled: False
|
||||||
mosquitto_user: Admin
|
mosquitto_user: Admin
|
||||||
mosquitto_password: g0adm1n
|
mosquitto_password: g0adm1n
|
||||||
|
mosquitto_port: 1883
|
||||||
|
|
|
@ -1,20 +1,44 @@
|
||||||
- name: Install nodejs-legacy
|
- name: Set up Node.js 8.x apt sources (debuntu, but avoid ubuntu-18)
|
||||||
package:
|
shell: curl -sL https://deb.nodesource.com/setup_8.x | bash -
|
||||||
name: "{{ item }}"
|
args:
|
||||||
state: present
|
warn: no
|
||||||
with_items:
|
when: internet_available and is_debuntu and not is_ubuntu_18
|
||||||
- nodejs-legacy
|
|
||||||
when: nodered_install
|
|
||||||
tags: download
|
|
||||||
|
|
||||||
- name: Install npm
|
- name: Install latest Node.js which includes /usr/bin/npm (debuntu, but avoid ubuntu-18)
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: nodejs
|
||||||
state: present
|
# name: nodejs=8.x
|
||||||
with_items:
|
state: latest
|
||||||
- npm
|
# state: present
|
||||||
when: nodered_install
|
when: internet_available and is_debuntu and not is_ubuntu_18
|
||||||
tags: download
|
|
||||||
|
# 2018-07-14: BOTH STEPS ABOVE TAKE TIME, but Raspbian (apt offers npm
|
||||||
|
# 1.4.21) & Debian 9 (apt offers no npm!) STILL NEED the above
|
||||||
|
# nodesource.com approach to get a version of npm that works with Sugarizer:
|
||||||
|
# https://github.com/iiab/iiab/issues/798#issuecomment-404324530
|
||||||
|
#
|
||||||
|
# MORE POSITIVELY: this nodesource.com approach (brings in npm 5.6.0 with
|
||||||
|
# nodejs 8.11.3 for now, to any OS) would also work on Ubuntu 18.04, and
|
||||||
|
# might even bring about a sane consistency across mainline OS's?
|
||||||
|
#
|
||||||
|
# BUT FOR NOW: Ubuntu 18.04's apt (approach below) brings in npm 3.5.2,
|
||||||
|
# which appears suffic "SO FAR"? 18.04's nodejs 8.10.0 is more reassuring!
|
||||||
|
|
||||||
|
# CRAZY IDEA: most versions of npm can upgrade themselves to the latest
|
||||||
|
# (6.2.0 for now) using command "npm install -g npm", if that helps us in
|
||||||
|
# future, e.g. TK's memory issue etc? If so, be CAREFUL this puts npm
|
||||||
|
# in /usr/local/bin on Ubuntu 18.04 -- unlike Ubuntu 16.04 and Raspbian
|
||||||
|
# where it upgrades /usr/bin/npm in place:
|
||||||
|
# https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation
|
||||||
|
|
||||||
|
- name: Install latest packages nodejs and npm (ubuntu-18 or not debuntu)
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- nodejs
|
||||||
|
- npm
|
||||||
|
state: latest
|
||||||
|
when: internet_available and (is_ubuntu_18 or not is_debuntu)
|
||||||
|
|
||||||
|
|
||||||
- name: Install node-red packages globally.
|
- name: Install node-red packages globally.
|
||||||
shell: npm install -g --unsafe-perm node-red node-red-admin node-red-dashboard
|
shell: npm install -g --unsafe-perm node-red node-red-admin node-red-dashboard
|
||||||
|
@ -29,6 +53,14 @@
|
||||||
name: nodered
|
name: nodered
|
||||||
group: nodered
|
group: nodered
|
||||||
|
|
||||||
|
- name: Create /home/nodered/.node-red/ directory
|
||||||
|
file:
|
||||||
|
path: "/home/nodered/.node-red"
|
||||||
|
state: directory
|
||||||
|
owner: nodered
|
||||||
|
group: nodered
|
||||||
|
mode: 0775
|
||||||
|
|
||||||
- name: Copy settings.js file with authentication
|
- name: Copy settings.js file with authentication
|
||||||
template:
|
template:
|
||||||
backup: yes
|
backup: yes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue