Closed angelnu closed 2 years ago
I think we should save to /config/config.boot
by default, but make it configurable. One use case I can think of is having the config file saved to an alternative location on a TFTP server for PXE booted VyOS instances. The provider configuration for this could look like:
provider "vyos" {
# ...
save = True
save_location = "tftp://10.0.0.1/config.boot"
}
I'm going to make some changes to the go client tomorrow, I'll add the Save
(and Load
) methods needed for this while I'm at it.
To be more consistent with the VyOS API parameters, I think we should actually name the fields:
provider "vyos" {
# ...
save = True
save_file = "..."
}
This should now be doable with https://github.com/Foltik/vyos-client-go/pull/2
Thanks @Foltik - are you looking for me to do the PR? I could do so in a few days.
If you're willing, that would be great!
@Foltik - added support to save configs -> #12. Please notice the dependency on https://github.com/Foltik/vyos-client-go/pull/3 where I added support for context (timeouts, cancels)
As there is no commit after the save the changes are lost on reboot.
I would like to avoid having to ssh into the routers to persist the changes. This could be accomplish either by default or based on a new provider configuration such as:
If we go with making it configurable - any reason for not making the default to be saving?
This change will also require an extension of the vyos_client. I can do PRs for both changes if @Foltik agrees on the proposal.