summaryrefslogtreecommitdiffstats
path: root/build/puppet-neutron/manifests/agents/ml2/networking-vpp.pp
blob: c25c281798e9274cfac65621319f34be085dedd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# == Class: neutron::agents::ml2::networking-vpp
#
# Setups networking-vpp Neutron agent for ML2 plugin.
#
# === Parameters
#
# [*package_ensure*]
#   (optional) Package ensure state.
#   Defaults to 'present'.
#
# [*enabled*]
#   (required) Whether or not to enable the agent.
#   Defaults to true.
#
# [*manage_service*]
#   (optional) Whether to start/stop the service
#   Defaults to true
#
# [*physnets*]
#   List of <physical_network>:<physical_interface>
#   tuples mapping physical network names to agent's node-specific physical
#   network interfaces. Defaults to empty list.
#
# [*flat_network_if*]
#   VPP interface used for flat network
#   Defaults to ''.
#
class neutron::agents::ml2::networking-vpp (
  $package_ensure   = 'present',
  $enabled          = true,
  $manage_service   = true,
  $physnets         = '',
  $flat_network_if  = '',
) {

  include ::neutron::params

  if $manage_service {
    if $enabled {
      $service_ensure = 'running'
    } else {
      $service_ensure = 'stopped'
    }
  }

  neutron_plugin_ml2 {
    'ml2_vpp/physnets': value => $physnets;
    'ml2_vpp/flat_network_if': value => $flat_network_if;
  }->
  service { 'networking-vpp-agent':
    ensure    => $service_ensure,
    name      => 'networking-vpp-agent',
    enable    => $enabled,
    tag       => 'neutron-service',
  }
}