-
Notifications
You must be signed in to change notification settings - Fork 21
/
install.pp
91 lines (84 loc) · 4.15 KB
/
install.pp
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class contrail::compute::install(
$opencontrail_only = false,
$enable_lbaas = $::contrail::params::enable_lbaas,
$enable_dpdk= $::contrail::params::enable_dpdk,
) {
$cur_kernel_version = $::kernelrelease
$dist_kernel_version = "${::contrail::params::contrail_dist_kernel_version}-generic"
notify{"compute_notify_1": name => "###DEBUG dist_kernel_version_test $dist_kernel_version_test ";} ->
notify{"compute_notify_2": name => "###DEBUG contrail_dist_kernel_version $dist_kernel_version and system kernel version is $cur_kernel_version";}
#Temporary work around untill we find out the root cause for inconsistent reboot resource behavior.
if ((($::contrail::params::kernel_upgrade == 'yes') or
($::contrail::params::kernel_upgrade == true)) and $cur_kernel_version != $dist_kernel_version ) {
Notify["compute_notify_2"]->
notify{"compute_notify_3": name => "###DEBUG inside if contrail_dist_kernel_version $dist_kernel_version and system kernel version is $cur_kernel_version";} ->
notify{"compute_notify_4": name => "Missed reboot for kernel Upgrade, Initiating a reboot";}
->
reboot { 'after_notify':
apply => "immediately",
timeout => 0,
message => "Rebooting for kernel upgrade",
subscribe => Notify["Missed reboot for kernel Upgrade, Initiating a reboot"],
}
} else {
Notify["compute_notify_2"]->
notify{"compute_notify_5": name => "Kernel Update Successful!";}
}
if ( $opencontrail_only == true) {
Notify["compute_notify_2"]->
package{ 'contrail-openstack-vrouter' :
ensure => latest,
notify => Service['supervisor-vrouter']
}
} else {
#Determine vrouter package to be installed based on the kernel
#TODO add DPDK support here
if ($::operatingsystem == 'Ubuntu'){
if ($::lsbdistrelease == '14.04') {
notify {"compute_notify_6": name => "enable_dpdk = ${enable_dpdk}"; }
if ($enable_dpdk == true ) {
Notify["compute_notify_2"]->
notify {"compute_notify_7": name => "settting up DPDK"; } ->
contrail::lib::setup_dpdk_depends{ 'dpdk_depends':} ->
#Might be temporary
#create the override and remove it
#create an overrride so that supervisor-vrouter doesnt start
#when installing the package
#This is needed only for dpdk
#as the prestart script uses config files
file { 'create_supervisor_vrouter_override':
path => "/etc/init/supervisor-vrouter.override",
ensure => present,
content => "manual",
} ->
Package[$vrouter_pkg, 'contrail-openstack-vrouter']
$vrouter_pkg = 'contrail-vrouter-dpdk-init'
} elsif ($::kernelrelease == '3.13.0-85-generic') {
$vrouter_pkg = 'contrail-vrouter-3.13.0-85-generic'
} else {
$vrouter_pkg = 'contrail-vrouter-dkms'
}
} elsif ($::lsbdistrelease == '12.04') {
if ($::kernelrelease == '3.13.0-34-generic') {
$vrouter_pkg = 'contrail-vrouter-3.13.0-34-generic'
} else {
$vrouter_pkg = 'contrail-vrouter-dkms'
}
}
} else {
$vrouter_pkg = 'contrail-vrouter'
}
# Main code for class starts here
# Ensure all needed packages are latest
package { [ $vrouter_pkg, 'contrail-openstack-vrouter'] : ensure => latest, notify => Service['supervisor-vrouter']}
# Install interface rename package for centos.
if (inline_template('<%= @operatingsystem.downcase %>') == 'centos') {
contrail::lib::contrail_rename_interface { 'centos-rename-interface' :
}
}
if ($enable_lbaas == true) {
Package[$vrouter_pkg, 'contrail-openstack-vrouter'] ->
package{ ['haproxy', 'iproute'] : ensure => present,}
}
}
}