ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.81k stars 928 forks source link

Specify format for configuration backup for VyOS/Vyatta/EdgeOS #2992

Closed yzguy closed 7 months ago

yzguy commented 11 months ago

This is a follow up of #1163

VyOS/Vyatta/EdgeOS allow you to get the configuration in two ways

The show configuration was the behavior of the model before #1164, but then changed to show configuration commands

I'm wondering if there is currently a way or if it would be possible (I'm cool to work on it as well) to allow the user to specify the format they want for that model in the configuration. I suppose both outputs could be captured in the same file by just adding another stanza, but allowing the user to specify format would be nice

To keep the current behavior the default could be set, and then a user could specify like hierarchy or something to get the other.

yzguy commented 11 months ago

So looking around, seems like variables aren't accessible in the models, as really models.rb is pulling things from the model not running the model file.

Per https://github.com/ytti/oxidized/blob/master/docs/Creating-Models.md, we can either extend the existing vyatta.rb or edgeos.rb and add additional commands, or we can create a new one that is exactly the same as existing file but the cmd line is changed.

We then store it in /home/oxidized/.config/oxidized/models/vyatta.rb, and it will be loaded instead of the one that comes with oxidized.

It would be nice if there were a way with a variable to basically toggle commands that get run detailed in the first comment