Tools to build configuration file


#1

Is there any tool for automatically build configuration file for VyOS in external machine with database with all parameters?
For example: I have couple of VyOS routers and I store all parameters in central Linux server in SQL database. I want to create configuration files for routers, based on changes in SQL database, and then load new config file in VyOS router.
How to do this?


#2

For example, I have all the commands like this in one file:

(...)
set service dhcp-server disabled 'false'
set service dhcp-server shared-network-name LAN subnet 192.168.0.0/24 default-router '192.168.0.1'
set service dhcp-server shared-network-name LAN subnet 192.168.0.0/24 dns-server '192.168.0.1'
set service dhcp-server shared-network-name LAN subnet 192.168.0.0/24 domain-name 'internal-network'
set service dhcp-server shared-network-name LAN subnet 192.168.0.0/24 lease '86400'
set service dhcp-server shared-network-name LAN subnet 192.168.0.0/24 start 192.168.0.9 stop '192.168.0.254'
(...)

how to make correct config file from this?


#3

just script those commands to run as they are. You don’t need to convert it to a config file.


#4

I think that I need to convert this commands into config file to upload this to router and update config on it. I want to make it automatic: I make some changes in database, generate new config file and then update routers configuration.