Fix docs path in common rpm spec file
[apex.git] / build / puppet-neutron / manifests / agents / ml2 / networking-vpp.pp
1 # == Class: neutron::agents::ml2::networking-vpp
2 #
3 # Setups networking-vpp Neutron agent for ML2 plugin.
4 #
5 # === Parameters
6 #
7 # [*package_ensure*]
8 #   (optional) Package ensure state.
9 #   Defaults to 'present'.
10 #
11 # [*enabled*]
12 #   (required) Whether or not to enable the agent.
13 #   Defaults to true.
14 #
15 # [*manage_service*]
16 #   (optional) Whether to start/stop the service
17 #   Defaults to true
18 #
19 # [*physnets*]
20 #   List of <physical_network>:<physical_interface>
21 #   tuples mapping physical network names to agent's node-specific physical
22 #   network interfaces. Defaults to empty list.
23 #
24 # [*etcd_host*]
25 #   etcd server host name/ip
26 #   Defaults to 127.0.0.1.
27 #
28 # [*etcd_port*]
29 #   etcd server listening port.
30 #   Defaults to 4001.
31 #
32 class neutron::agents::ml2::networking-vpp (
33   $package_ensure   = 'present',
34   $enabled          = true,
35   $manage_service   = true,
36   $physnets         = '',
37   $etcd_host        = '127.0.0.1',
38   $etcd_port        = 4001,
39 ) {
40
41   include ::neutron::params
42
43   Neutron_agent_vpp<||> ~> Service['networking-vpp-agent']
44
45   neutron_agent_vpp {
46     'ml2_vpp/physnets': value => $physnets;
47     'ml2_vpp/etcd_host': value => $etcd_host;
48     'ml2_vpp/etcd_port': value => $etcd_port;
49     'DEFAULT/host': value => $::fqdn;
50   }
51
52   if $manage_service {
53     if $enabled {
54       $service_ensure = 'running'
55     } else {
56       $service_ensure = 'stopped'
57     }
58   }
59
60   service { 'networking-vpp-agent':
61     ensure => $service_ensure,
62     name   => 'networking-vpp-agent',
63     enable => $enabled,
64   }
65 }