Add timeout for VPP interface command 69/42369/6
authorFeng Pan <fpan@redhat.com>
Tue, 19 Sep 2017 03:41:10 +0000 (23:41 -0400)
committerFeng Pan <fpan@redhat.com>
Sun, 24 Sep 2017 04:12:33 +0000 (00:12 -0400)
We need to have a time out before trying to create VPP tap interfaces.

Change-Id: I9954240529278e74d93fdf89d2ebc2536249245a
Signed-off-by: Feng Pan <fpan@redhat.com>
manifests/profile/base/neutron/opendaylight.pp
manifests/profile/base/vpp.pp

index a766b1a..6eb56de 100644 (file)
@@ -35,7 +35,7 @@ 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', [])) {
+  if hiera('vpp_enabled', false) and ('odl-lispflowmapping-msmr' in hiera('opendaylight::extra_features', [])) {
     file { 'org.opendaylight.groupbasedpolicy.renderer.vpp.startup.cfg':
       ensure => file,
       path   => '/opt/opendaylight/etc/org.opendaylight.groupbasedpolicy.renderer.vpp.startup.cfg',
index 4eff434..c9759f6 100644 (file)
@@ -34,11 +34,24 @@ class tripleo::profile::base::vpp (
     # 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",
+      exec { 'vpp admin - kernel 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",
         path    => ['/bin', '/sbin'],
         unless  => 'ip link show veth-admin | grep br-ctlplane',
-        require   => Class['fdio'],
+        require => Class['fdio'],
+      }
+      file_line { 'create vpp-admin interface':
+        path => '/etc/vpp/vpp-exec',
+        line => "create host-interface name vpp-admin",
+      } ->
+      file_line { 'set vpp-admin interface ip':
+        path => '/etc/vpp/vpp-exec',
+        line => "set int ip addr host-vpp-admin ${vpp_ctlplane_cidr}",
+      } ->
+      file_line { 'unshut vpp-admin interface':
+        path   => '/etc/vpp/vpp-exec',
+        line   => "set interface state host-vpp-admin up",
+        notify => Service['vpp'],
       }
     }
   }