1 # == Class ovsdpdk::postinstall_ovs_dpdk
3 # Postinstall configuration of ovs-dpdk service
5 class ovsdpdk::postinstall_ovs_dpdk (
6 $plugin_dir = $::ovsdpdk::params::plugin_dir,
7 $nova_conf = $::ovsdpdk::params::nova_conf,
8 $openvswitch_service_name = $::ovsdpdk::params::openvswitch_service_name,
9 $ml2_ovs_conf = $::ovsdpdk::params::ml2_ovs_conf,
10 $neutron_l3_conf = $::ovsdpdk::params::neutron_l3_conf,
11 $openvswitch_agent = $::ovsdpdk::params::openvswitch_agent,
14 require ovsdpdk::install_ovs_dpdk
16 package {'crudini': ensure => installed }
18 if $compute == 'True' {
19 # adapt configuration files
20 exec {'adapt_nova_conf':
21 command => "${plugin_dir}/files/set_vcpu_pin.sh ${nova_conf}",
22 path => ['/usr/bin','/bin'],
24 onlyif => "test -f ${nova_conf}",
25 require => Package['crudini'],
28 exec {'adapt_ml2_conf':
29 command => "sudo crudini --set ${ml2_ovs_conf} ovs datapath_type ${ovs_datapath_type}",
30 path => ['/usr/bin','/bin'],
32 onlyif => "test -f ${ml2_ovs_conf}",
33 require => Package['crudini'],
36 exec {'adapt_neutron_l3':
37 command => "sudo crudini --set ${neutron_l3_conf} DEFAULT external_network_bridge br-ex",
38 path => ['/usr/bin','/bin'],
40 onlyif => "test -f ${neutron_l3_conf}",
41 require => Package['crudini'],
45 service {"${openvswitch_service_name}": ensure => 'running' }
47 # restart OVS to synchronize ovsdb-server with ovs-vswitchd needed
48 # due to several new --no-wait entries
50 command => "/usr/sbin/service ${openvswitch_service_name} restart",
52 require => Service["${openvswitch_service_name}"],
55 exec { "${plugin_dir}/files/configure_bridges.sh ${ovs_datapath_type}":
57 require => Exec['restart_ovs'],
61 if $controller == 'True' {
62 service {'neutron-server':
67 if $compute == 'True' {
68 service {"${openvswitch_agent}":
70 require => [ Exec['restart_ovs'], Service["${openvswitch_service_name}"] ],