I’m trying to automatically set up openhab2 on a Debian machine through an ansible task. Adding the repository and installing the packages works fine, an so does copying pre-defined configuration files into /etc/openhab2. However, I’m a bit lost when it comes to installing add-ons. I suppose one could let ansible execute something like
on the remote machine, but I just can’t figure out what to enter for [whatever]. The bundle:install command apparently expects an URI, but how to find out the URI for a specific add-on? (In my case, I’m particularly interested in the TCP/UDP binding and JSONPath transformation add-ons.)
So does anyone know how to find the URL for a specific add-on? Or is there a better way to install add-ons through ansible?
(A secondary problem would be how to set/change/provide the openhab2 password through ansible…)
You should be able to define a list of addons to install in |/etc/openhab2/services/addons.cfg|.
well, in this file it is stated that “This is only regarded at the VERY FIRST START of openHAB”, which isn’t very helpful in case I want to change the list of add-ons to be installed later.
Furthermore, the add-on designations to be used in this file are rather semi-intuitive – for instance, what would be the correct designation of the “TCP & UDP Binding” (as it is called on http://docs.openhab.org/addons/bindings/tcp1/readme.html)?
So is there any way to install additional add-ons from the command line later on?
I think the very first start is referring to the installation package only:
#package = minimal
which is only checked once. It should check the others at least each launch so this should be fine for changing the list later.
The correct designation for that specific binding is “tcp1”. The path after “/bindings/” in the docs is the name the services usually refer to. The appended 1 simply refers to the fact that it’s a binding from openHAB 1.x.
EDIT: I’ve just tested changing the addons.cfg file. It installs the list of bindings as soon as the file is updated, it will also uninstall ones that are no longer in the list.
which is only checked once. It should check the others at least each launch so this should be fine for changing the list later.
The correct designation for that specific binding is “tcp1”. The path after “/bindings/” in the docs is the name the services usually refer to. The appended 1 simply refers to the fact that it’s a binding from openHAB 1.x.
EDIT: I’ve just tested changing the addons.cfg file. It installs the list of bindings as soon as the file is updated, it will also uninstall ones that are no longer in the list.
that’s cool – that seems to be exactly what I need! (And it’s also much simpler than issuing a Karaf command though ssh through ansible…)
The only remaining question is: How can I figure out the add-on names myself – I don’t want to bother the forum all the time I need another entry in addons.cfg…