-
Notifications
You must be signed in to change notification settings - Fork 21
/
service.pp
36 lines (36 loc) · 1.25 KB
/
service.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
class contrail::compute::service(
$nova_compute_status = $::contrail::compute::config::nova_compute_status,
$host_control_ip = $::contrail::params::host_ip,
$compute_ip_list = $::contrail::params::compute_ip_list,
$nfs_server = $::contrail::params::nfs_server,
$contrail_logoutput = $::contrail::params::contrail_logoutput,
) {
if !('toragent' in $contrail::params::host_roles) {
service { 'supervisor-vrouter':
ensure => running,
enable => true,
}
}
if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') {
$nova_service_name = "openstack-nova-compute"
exec { 'sevc-openstk-nova-restart' :
command => "service ${nova_service_name} restart",
provider => shell,
logoutput => $contrail_logoutput,
}
} else {
$nova_service_name = "nova-compute"
}
service { $nova_service_name :
enable => $nova_compute_status,
ensure => $nova_compute_status,
}
## Same condition as compute/config.pp
if ($nfs_server == 'xxx' and $host_control_ip == $compute_ip_list[0] ) {
Service['nova-compute']->
service { 'nfs-kernel-server':
ensure => running,
enable => true
}
}
}