Install/remove modules via command line Linux

I’m using the docker file kindly shared by @kcollins (thanks Kevin, it’s awesome!).

I would love to make the modules installed configurable. Does anybody have any idea if installing or removing modules via command line is possible??

Cheers,
Keiran

So, if developer module upload is available, you should be able to script a POST to the install URL. I’ve never done that, so I can’t offer an example. What I do instead is load modules by placing them into the server’s modules folder while the gateway is stopped. If you perform a few judicious INSERTs and UPDATEs to config.idb via the sqlite3 command line tool, the modules will run on gateway restart.

To figure out what you need to script with sqlite3:

  • Install a fresh gateway, without any projects/tags/etc, then shut it down.
  • Use sqlite3’s .dump utility to export config.idb as text.
  • Restart the gateway, and install the module of interest, then shut back down.
  • Use sqlite3 to do another export, and diff that against the original.

Then you can write a script generate those entries when you load the module file into the modules folder. In my kickstart scripts, using the zip installers, I do the following:

  • Extract the zip with none of the modules, distribute to the appropriate folders, tweak the config, and start it up.
  • Monitor for the RUNNING state (moderately quick with no modules at all), then shut it back down.
  • Extract the desired modules from the zip, add third party modules, adjust config.idb, and start it back up.
4 Likes

@CHH, I’m glad you’re getting value out of the Docker setup! The procedure that @pturmel mentions is on my list for integration into the Docker solution. If everything goes according to plan, it will work similarly to the gateway restore process—if you mount module files into a specific folder within the container, the entry point script will pick those up and make the needed modifications (for accepting the license and importing the certificate). Hopefully I can make some progress on this over the holidays. I’ve got a bit of a backlog of things on the Ignition/Docker front, but it is on the list! :slight_smile:

5 Likes

Great, thanks @pturmel and @Kevin.Collins - I’ll give that a whirl. @Kevin.Collins I’ll push if I end up with anything of value!

I am working on a similar issue where I need to make sure to have the docker image come up as expected with appropriate modules installed etc. I am new to ignition-edge in a container…I am curios if the back processes mentioned in another post achieves the same goals or what might i be missing.

All: The latest push to kcollins/ignition:8.0.2 and kcollins/ignition:7.9.11 now have support for third party modules! All you have to do is bind-mount a folder containing the modules you want to add and the entrypoint script will scoop them up and accept the certs/eulas automatically. See the “How to integrate third party modules” section in the guidance on Docker Hub: https://hub.docker.com/r/kcollins/ignition

Feedback welcome as always, either here or in a GitHub issue. Enjoy!

4 Likes