summaryrefslogtreecommitdiff
path: root/lib/oxidized
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2018-06-12 00:32:22 +0300
committerSaku Ytti <saku@ytti.fi>2018-06-12 00:32:22 +0300
commit2158cf358270fe37b60d85eb1d18a25730edbadd (patch)
treeeb462afe2c393b117f0b3a6da0fe3a8fe4da1f10 /lib/oxidized
parentf9c5f300e46e786de95abcb5bbaa7ae6cedd588a (diff)
parent537a24f3c37b577ec174bced319d2c3fdb5322f7 (diff)
Merge branch 'master' of github.com:ytti/oxidized
Diffstat (limited to 'lib/oxidized')
-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'