From 537a24f3c37b577ec174bced319d2c3fdb5322f7 Mon Sep 17 00:00:00 2001 From: Brad Searle Date: Tue, 12 Jun 2018 07:29:24 +1000 Subject: Add support for frr in new versions of cumulus - closes #1087 (#1375) --- lib/oxidized/model/cumulus.rb | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'lib/oxidized/model/cumulus.rb') diff --git a/lib/oxidized/model/cumulus.rb b/lib/oxidized/model/cumulus.rb index 334e1e4..f53ca73 100644 --- a/lib/oxidized/model/cumulus.rb +++ b/lib/oxidized/model/cumulus.rb @@ -13,6 +13,11 @@ class Cumulus < Oxidized::Model # show the persistent configuration pre do + # Set FRR or Quagga in config + routing_daemon = vars(:cumulus_routing_daemon) ? vars(:cumulus_routing_daemon).downcase : 'quagga' + routing_conf_file = routing_daemon == 'frr' ? 'frr.conf' : 'Quagga.conf' + routing_daemon_shout = routing_daemon.upcase + cfg = add_comment 'THE HOSTNAME' cfg += cmd 'cat /etc/hostname' @@ -34,23 +39,23 @@ class Cumulus < Oxidized::Model cfg += add_comment 'SNMP settings' cfg += cmd 'cat /etc/snmp/snmpd.conf' - cfg += add_comment 'QUAGGA DAEMONS' - cfg += cmd 'cat /etc/quagga/daemons' + cfg += add_comment "#{routing_daemon_shout} DAEMONS" + cfg += cmd "cat /etc/#{routing_daemon}/daemons" - cfg += add_comment 'QUAGGA ZEBRA' - cfg += cmd 'cat /etc/quagga/zebra.conf' + cfg += add_comment "#{routing_daemon_shout} ZEBRA" + cfg += cmd "cat /etc/#{routing_daemon}/zebra.conf" - cfg += add_comment 'QUAGGA BGP' - cfg += cmd 'cat /etc/quagga/bgpd.conf' + cfg += add_comment "#{routing_daemon_shout} BGP" + cfg += cmd "cat /etc/#{routing_daemon}/bgpd.conf" - cfg += add_comment 'QUAGGA OSPF' - cfg += cmd 'cat /etc/quagga/ospfd.conf' + cfg += add_comment "#{routing_daemon_shout} OSPF" + cfg += cmd "cat /etc/#{routing_daemon}/ospfd.conf" - cfg += add_comment 'QUAGGA OSPF6' - cfg += cmd 'cat /etc/quagga/ospf6d.conf' + cfg += add_comment "#{routing_daemon_shout} OSPF6" + cfg += cmd "cat /etc/#{routing_daemon}/ospf6d.conf" - cfg += add_comment 'QUAGGA CONF' - cfg += cmd 'cat /etc/quagga/Quagga.conf' + cfg += add_comment "#{routing_daemon_shout} CONF" + cfg += cmd "cat /etc/#{routing_daemon}/#{routing_conf_file}" cfg += add_comment 'MOTD' cfg += cmd 'cat /etc/motd' -- cgit v1.2.1