Certain feature sets allow running custom scripts on the local VyOS machine. For example: The high-availability feature, or specifically the transition scripts, allow running scripts when e.g. a failover occurs. (see https://docs.vyos.io/en/sagitta/configuration/highavailability/index.html#transition-scripts)
I'd have the use-case to use such feature, however trying to avoid it at all costs as these scripts are not persisted inside the configuration file.
Above suggestions could be persisted as base64 in the configuration file and re-written to disk when restored. Commands could be designed to not be a breaking change.
This feature request is about allowing:
- directly specifying one-liner commands as the command to run on these events
Example:
set high-availability vrrp group foo transition-script master "restart service frr && set nat source rule 100 source address '192.0.2.2/24'"
If the first part is not a file (which it usually is), the transition script is considered a command. If it is a file path, it remains with current behavior.
- allow saving entire configuration files in the config
Example:
set high-availability vrrp group foo transition-script master file
or
set high-availability vrrp group foo transition-script master file "transition-master.sh"
Which is then opened in a editor like "nano" for interactively editing the script everything when running.
- allow saving entire configuration files in the config via automation
Example:
set high-availability vrrp group foo transition-script master base64 "[...]"
Which is then decoded and used accordingly. This is useful for automation to e.g. change scripts dynamically.