summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/cumulus.rb
diff options
context:
space:
mode:
authorBrad Searle <bobthebutcher@users.noreply.github.com>2018-06-12 07:29:24 +1000
committerWild Kat <wk@users.noreply.github.com>2018-06-11 23:29:24 +0200
commit537a24f3c37b577ec174bced319d2c3fdb5322f7 (patch)
tree293f1fd6db9f778605e8980a42f2191324435c43 /lib/oxidized/model/cumulus.rb
parent5df10b5a6880747a9f659905dd7b4b75f338c8bb (diff)
Add support for frr in new versions of cumulus - closes #1087 (#1375)
Diffstat (limited to 'lib/oxidized/model/cumulus.rb')
-rw-r--r--lib/oxidized/model/cumulus.rb29
1 files changed, 17 insertions, 12 deletions
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'