Puppet Class: quagga::zebra

Defined in:
manifests/zebra.pp

Summary

manage the main zebra process

Overview

Parameters:

  • agentx (Boolean)

    Manage SNMP agentx processes for the main quagga zebra process

  • hostname (String)

    Router’s hostname

  • global_opts (Hash)

    Global options for all daemons

  • interfaces (Hash)

    Global network interface parameters

  • prefix_lists (Hash)

    Create prefix lists

  • route_maps (Hash)

    Create route-map entries

  • routes (Hash)

    Define static routes

  • access_lists (Hash)

    Define access lists to use elsewhere in quagga config

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

    The main configuration file name

  • config_file_manage (Boolean)

    Manage the content of the configuration file

  • service_name (String)

    the main zebra service name

  • service_enable (Boolean)

    enable the service

  • service_manage (Boolean)

    manage the service state

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

    manage the actual service state of stopped or running

  • service_opts (String)

    service startup options

  • frr_mode_enable (Boolean)


38
39
40
41
42
43
44
45
46
47
48
49
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
116
117
118
119
120
121
122
123
124
# File 'manifests/zebra.pp', line 38

class quagga::zebra (
  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,
  String $hostname,
  Hash $global_opts,
  Hash $interfaces,
  Hash $prefix_lists,
  Hash $route_maps,
  Hash $routes,
  Hash $access_lists,
  Stdlib::Unixpath $config_file               = "${quagga::config_dir}/zebra.conf",
) {
  include quagga::zebra::config
  include quagga::zebra::service

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

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

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

    quagga_global { $hostname:
      * => $global_opts,
    }

    $interfaces.each |String $interface_name, Hash $interface| {
      quagga_interface { $interface_name:
        * => $interface,
      }
    }

    resources { 'quagga_prefix_list':
      purge => true,
    }

    $prefix_lists.each |String $prefix_list_name, Hash $prefix_list| {
      quagga_prefix_list { $prefix_list_name:
        * => $prefix_list,
      }
    }

    resources { 'quagga_route_map':
      purge => true,
    }

    $route_maps.each |String $route_map_name, $route_map| {
      quagga_route_map { $route_map_name:
        * => $route_map,
      }
    }

    $routes.each |String $route_title, Hash $route| {
      quagga_static_route { $route_title:
        * => $route,
      }
    }

    $access_lists.each |$access_list_name, Hash $access_list| {
      $list_name = $access_list_name ? {
        Integer => sprintf('%d', $access_list_name),
        default => $access_list_name,
      }

      quagga_access_list { $list_name:
        * => $access_list,
      }
    }
  }
}