Open troglobit opened 3 months ago
@wkz + @mattiaswal RFC on an idea I that's been floating around for a while. The most important feature in my mind right now is the validation, so that users can verify the new configuration would actually work.
I like it!
Some initial thoughts:
configure
program in the future (retiring cli
and letting bash
assume the role of admin-exec), I think we should choose a name that is a bit more distinct in order to avoid future confusion. Maybe cfgcp
for "configuration copy"yanglint
's -Y
option.cfgcp
could have a -n
/--dry-run
option that only runs validationInteresting, maybe as a general rule of thumb, use the same names as we use today in the CLI admin-exec context, in this case copy
? Would mean less retraining of personnel and possibly less support issues.
For the validation, my idea was to connect to sysrepo, import the file to candidate, and run the validation/check we do today from the CLI. That way we don't need to first extract all modules and enabled features using sysrepoctl
to feed into yanglint
.
A validation could then look like:
admin@example:~$ copy --dry-run some-file.cfg running-config
Incompatible source (some-file.cfg) with system YANG models:
<detailed error from libyang via sysrepo>
Yes, that is way better than my suggestion! :+1:
Suggestion to add a command line tool, similar to sysrepocfg, but one that knows more about Infix.
/cfg
for storing files.cfg
files, when importing old backups