Support for "Code Plugs"

Hi All,

I’m trying to think how to achieve a solution to a problem and I thought I’d ask here before raising a feature request or working on a solution myself.

I’m often in situations where I have several routers deployed out in the field. They are all the same hardware (x86 computer basically) but each has a different config on it. For the sake of this thought experiment assume there are 50 routers and 2 spares on a shelf back at the depot.

If there’s a failure on site then a field tech will be dispatched with a spare and told to swap the router out. Said tech will have the competence to do the hardware swap and make sure the connectors are all in the right place but does not have the competence to SSH/Serial into the router and apply configuration.

Normally, we solve this problem with other equipment (like switches) by using a “code plug”. This is just a USB flash drive which contains the configuration on it. When the device boots it reads the flash and auto applies whatever configuration is on it. So the tech just has to make sure the code plug is in there and they know the device will be configured and up and running within a few seconds/minutes.

I therefore have three questions for the VyOS community:

  1. Is there already a way to do this in VyOS?
  2. Can anyone think of a better way of doing this?
  3. Would the community be interested in me implementing this feature?

Thanks

Chris

Use Command scripting — VyOS 1.5.x (circinus) LTS and have it check for the availability of a named config on a USB device (assuming you have made it auto mounting), and if found, copy it to /config?

Or provide the default install with a minimal network config so it can access a configuration server over IP and you can do a "load http://… to fetch a config on boot if the default config is detected?

1 Like

Interesting idea. I think that could work. Wouldn’t be able to use the load from network approach as I can’t guarantee that the device has network connectivity on boot. It’s on a moving vehicle with 4G so might be in a dead spot etc.

I would like the functionality such that when a new configuration is created through a commit it is synchronised to the code plug. Basically, I want the entire /config directory to be stored on the code plug. Maybe that’s an approach that can be investigated…

You might want to look into Command scripting — VyOS 1.5.x (circinus) LTS which does exactly what you want I think.

Just create a post-commit script that creates a YYYMDD-HHMMSS.tar.gz from /config on the USB device.