floored1585/quagga-cookbook

View on GitHub
templates/default/ospfd.conf.erb

Summary

Maintainability
Test Coverage
!!! OSPF CONFIGURATION
!
<% unless node['quagga']['integrated_vtysh_config'] -%>
hostname ospfd
password <%= node['quagga']['password'] %>
enable password <%= node['quagga']['enabled_password'] %>
log file /var/log/quagga/ospfd.log
!
<% end -%>
<% @interfaces.each do |port,opts|-%>
interface <%= port %>
  <% opts.each do |opt|-%>
 <%= opt %>
  <% end -%>
!
<% end -%>
router ospf
<% if @router_id -%>
 ospf router-id <%= @router_id %>
<% end -%>
<% if @reference_bandwidth -%>
 auto-cost reference-bandwidth <%= @reference_bandwidth%>
<% end -%>
<% Array(@redistribute).each do |route_type| -%>
  <% next unless %w( babel bgp connected isis kernel ospf ospf6 rip static table ).include? route_type -%>
 redistribute <%= route_type %>
<% end -%>
<% @areas.each do |area, opts| -%>
  <% Array(opts['networks']).each do |network| -%>
 network <%= network  %> area <%= area %>
  <% end -%>
  <% if opts['stub_area'] -%>
 area <%= area %> stub
  <% end -%>
<% end -%>
<% if @passive_default -%>
 passive-interface default
  <% @interfaces.each do |int,opts|-%>
 no passive-interface <%= int %>
  <% end -%>
<% end -%>
<% Array(@passive_ints).each do |int| -%>
 passive-interface <%= int %>
<% end -%>
!
line vty