Add support for odl-fdio-dvr scenarios 17/38817/3
authorFeng Pan <fpan@redhat.com>
Mon, 7 Aug 2017 02:26:04 +0000 (22:26 -0400)
committerFeng Pan <fpan@redhat.com>
Thu, 10 Aug 2017 02:18:29 +0000 (02:18 +0000)
Change-Id: I2025e3157b97b376b63002003ca17c7206aba546
Signed-off-by: Feng Pan <fpan@redhat.com>
manifests/profile/base/neutron/opendaylight.pp
manifests/profile/base/vpp.pp

index 89dbf83..a766b1a 100644 (file)
@@ -35,7 +35,42 @@ class tripleo::profile::base::neutron::opendaylight (
   $odl_api_ips  = hiera('opendaylight_api_node_ips'),
   $node_name    = hiera('bootstack_nodeid')
 ) {
-
+  if hiera('vpp_enabled', false) and ('odl-router_v2' in hiera('neutron::service_plugins', [])) {
+    file { 'org.opendaylight.groupbasedpolicy.renderer.vpp.startup.cfg':
+      ensure => file,
+      path   => '/opt/opendaylight/etc/org.opendaylight.groupbasedpolicy.renderer.vpp.startup.cfg',
+      owner  => 'odl',
+      group  => 'odl',
+    }
+    $odl_bind_ip = hiera('opendaylight::odl_bind_ip')
+    file_line { 'odl-ip':
+      path  => '/opt/opendaylight/etc/org.opendaylight.groupbasedpolicy.renderer.vpp.startup.cfg',
+      line  => "odl.ip = ${odl_bind_ip}",
+      match => '^odl.ip =.*$',
+    }
+    file_line { 'gbp.lisp.enabled':
+      path  => '/opt/opendaylight/etc/org.opendaylight.groupbasedpolicy.renderer.vpp.startup.cfg',
+      line  => "gbp.lisp.enabled = true",
+    }
+    file_line { 'vpp.lisp.mapregister.enabled':
+      path  => '/opt/opendaylight/etc/org.opendaylight.groupbasedpolicy.renderer.vpp.startup.cfg',
+      line  => "vpp.lisp.mapregister.enabled = true",
+    }
+    file_line { 'vpp.l3.flat.enabled':
+      path  => '/opt/opendaylight/etc/org.opendaylight.groupbasedpolicy.renderer.vpp.startup.cfg',
+      line  => "vpp.l3.flat.enabled = true",
+    }
+    file { '/opt/opendaylight/etc/custom.properties':
+      ensure => file,
+      path   => '/opt/opendaylight/etc/custom.properties',
+      owner  => 'odl',
+      group  => 'odl',
+    }
+    file_line { 'lisp.authEnabled':
+      path  => '/opt/opendaylight/etc/custom.properties',
+      line  => "lisp.authEnabled = false",
+    }
+  }
   if $step == 1 {
     validate_array($odl_api_ips)
     if empty($odl_api_ips) {
index 05f52f9..4eff434 100644 (file)
 #   Defaults to hiera('step')
 #
 class tripleo::profile::base::vpp (
-  $step        = hiera('step'),
+  $step = hiera('step'),
+  $vpp_ctlplane_cidr = hiera('vpp_ctlplane_cidr', undef)
 ) {
   if $step >= 1 {
     include ::fdio
+
+    # Need to use the controller's real IP since we only support noha scenario
+    # If this is a ha scenario, we won't configure here.
+    $controllers = any2array(split(hiera('controller_node_ips'), ','))
+    if !empty($vpp_ctlplane_cidr) and size($controllers) == 1 {
+      exec { 'vpp admin interface config':
+        command => "ip link add vpp-admin type veth peer name veth-admin && ip li set dev veth-admin master br-ctlplane && ifconfig veth-admin up && vppctl create host-interface name vpp-admin && vppctl set int ip addr host-vpp-admin ${vpp_ctlplane_cidr} && vppctl set interface state host-vpp-admin up",
+        path    => ['/bin', '/sbin'],
+        unless  => 'ip link show veth-admin | grep br-ctlplane',
+        require   => Class['fdio'],
+      }
+    }
   }
 }