Specify user in the update-nodejs-and-nodered script

I've been learning Ansible for automatic deployment of NODE-RED and ran into a stumbling block.
The pi zero w (assuming all armv6's) doesn't have an official nodejs rep so one would need to use the bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) install script.

The installation requires elevated privileges however running the script as 'become:true' (and all the --confirm arguments) and has the side effect of installing under /root which is not ideal.

In stead of trying to figure out how to store and pass credentials to a script in Ansible it was a lot easier to fork the linux-installers and add a --nodered-user to the argument list in update-nodejs-and-nodered. see fork

If anyone else knows the proper way to do it I'd love to know. If anyone else finds this addition useful then I'd like to assist in adding a PR for it

Happy to consider a PR for this as an option.

1 Like

I noticed the rpm script doesn't accept arguments for the script. I don't run any rpm distros but I could add the same arguments in the deb code to the rpm code so that the two match more closely, I'll have to spin up a few different rpm vms to test then I'll update the fork and put in a PR.

If you do that please do it as a separate PR. The rpm installer is deliberately much simpler as it doesn’t need to cope with the nuances of Pi processor architectures, gpio nodes etc. so any extra options need to be discussed beforehand. Thanks

I've added a PR for the modifying the deb installer along with results of my testing

2 Likes