vrnetlab icon indicating copy to clipboard operation
vrnetlab copied to clipboard

Add CLI argument for extra lines of configuration

Open plajjan opened this issue 7 years ago • 3 comments

We should add a CLI argument to add extra lines of configuration when the bootstrap configuration is applied to the device.

vrnetlab has no aspiration of becoming a generic configuration management system. The focus has always been, and will continue to be, on doing the minimal amount of configuration so that the router can then be configured through NETCONF/YANG. vrnetlab configures this bootstrap config across a serial console which is both slow and error prone so trying to shove a large configuration through that mechanism is a bad idea.

Sometimes however, it can be useful to be able to enter a few extra lines of config and so I think we should have an option for that. Those lines are sent to the device in the bootstrap_config() function, while we are in configuration mode. I.e. the user doesn't need to bother with doing "configure" first or committing the configuration at the end.

I suggest we called the CLI arg --extra-config and that it's a semi-colon separated list of commands to run.

plajjan avatar Oct 25 '17 12:10 plajjan

Wouldn't a file be better than trying to cram it all on the command line?

emjemj avatar Feb 21 '18 21:02 emjemj

@emjemj in my case no, I think it's easier sticking to a CLI arg and I don't want a bunch of small temp files on disk. One doesn't exclude the other though, we could have a --extra-config-file, cool? Will you implement it? :)

plajjan avatar Mar 26 '18 15:03 plajjan

I see where this is going ;) Also, as you've stated before, repeating --extra-config for each line would be prettier than semi-colon separated list of commands. Possibly with a short-hand -X or similar to reduce typing.

emjemj avatar Apr 02 '18 17:04 emjemj