Puppet Class: quagga::bgp

Defined in:
manifests/bgp.pp

Summary

Manage the Quagga BGP Daemon

Overview

This class is automatically included when you include the main quagga class. However, it has a number of parameters that can be set via hiera.

Parameters:

  • agentx (Boolean)

    Enable SNMP integration

  • config_file (Stdlib::Unixpath) (defaults to: "${quagga::config_dir}/bgpd.conf")

    Path to the quagga configuration file for BGP

  • config_file_manage (Boolean)

    If true, manage the existence of the ‘$config_file`

  • service_name (String)

    System service name for quagga bgpd

  • service_enable (Boolean)

    Manages the state of the service at boot

  • service_manage (Boolean)

    If true, manages the state of the BGP daemon and the SNMP agentx

  • service_ensure (Enum['running', 'stopped'])

    Ensures the service is either stopped or running.

  • service_opts (String)

    Options for the BGP service

  • router (Hash)

    Parameters for the router process.

  • peers (Hash)

    BGP Peers.

  • as_paths (Hash)

    AS Path rules.

  • community_lists (Hash)

    BGP Community list options.

  • address_families (Hash)

    BGP Address family options.

  • frr_mode_enable (Boolean)

See Also:

  • quagga_bgp_router
  • puppet_classes::quagga::bgpquagga::bgp::peer
  • quagga_bgp_as_path
  • quagga_bgp_community_list
  • quagga_bgp_address_family


50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'manifests/bgp.pp', line 50

class quagga::bgp (
  Boolean $agentx,
  Boolean $config_file_manage,
  String $service_name,
  Boolean $service_enable,
  Boolean $service_manage,
  Boolean $frr_mode_enable,
  Enum['running', 'stopped'] $service_ensure,
  String $service_opts,
  Hash $router,
  Hash $peers,
  Hash $as_paths,
  Hash $community_lists,
  Hash $address_families,
  Stdlib::Unixpath $config_file               = "${quagga::config_dir}/bgpd.conf",
) {
  include quagga::bgp::config
  include quagga::bgp::service

  if $service_enable and $service_ensure == 'running' {
    $agentx_ensure = $agentx ? {
      true  => 'present',
      false => 'absent'
    }

    file_line { 'bgp_agentx':
      ensure => $agentx_ensure,
      path   => $config_file,
      line   => 'agentx',
    }

    if $service_manage {
      File_line['bgp_agentx'] {
        notify => Service[$service_name]
      }
    }

    quagga_bgp_router { 'bgp':
      * => $router,
    }

    $peers.each |String $peer_name, Hash $peer| {
      quagga::bgp::peer { $peer_name:
        * => $peer,
      }
    }

    $as_paths.each |String $as_path_name, Hash $as_path| {
      quagga_bgp_as_path { $as_path_name:
        * => $as_path,
      }
    }

    $community_lists.each |Integer $community_list_name, Hash $community_list| {
      quagga_bgp_community_list { sprintf('%d', $community_list_name):
        * => $community_list,
      }
    }

    $address_families.each |String $address_family_name, Hash $address_family| {
      quagga_bgp_address_family { $address_family_name:
        * => $address_family,
      }
    }
  }
}