6wind-virtual-accelerator-plugin: use service instead of exec
This patch reworks the scripts to use the puppet service resource instead of calling services using exec. Change-Id: Ib28ca7100a24a57f1b9074ef7eee6d079308233b Signed-off-by: Francesco Santoro <francesco.santoro@6wind.com>
This commit is contained in:
parent
35f1cd37a4
commit
c309df02a2
|
@ -18,8 +18,8 @@ class virtual_accelerator::config inherits virtual_accelerator {
|
|||
mode => 0644,
|
||||
source => 'puppet:///modules/virtual_accelerator/cpu-cgroup.conf',
|
||||
} ->
|
||||
exec {'mount_cgroup':
|
||||
command => "service cpu-cgroup start",
|
||||
service { 'cpu-cgroup':
|
||||
ensure => 'running',
|
||||
}
|
||||
|
||||
$fp_mem = $virtual_accelerator::fp_mem
|
||||
|
|
|
@ -16,13 +16,17 @@ class virtual_accelerator::neutron_conf inherits virtual_accelerator {
|
|||
} ->
|
||||
exec { 'disable_ipset':
|
||||
command => "crudini --set ${OVS_CONF_FILE} securitygroup enable_ipset False",
|
||||
} ->
|
||||
exec { 'restart_ovs':
|
||||
command => 'service openvswitch-switch restart',
|
||||
} ->
|
||||
exec { 'restart_ovs_agent':
|
||||
command => 'service neutron-plugin-openvswitch-agent restart',
|
||||
notify => Service['openvswitch-switch'],
|
||||
}
|
||||
|
||||
service { 'openvswitch-switch':
|
||||
ensure => 'running',
|
||||
notify => Service['neutron-plugin-openvswitch-agent'],
|
||||
}
|
||||
|
||||
service { 'neutron-plugin-openvswitch-agent':
|
||||
ensure => 'running',
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,25 +6,37 @@ class virtual_accelerator::service inherits virtual_accelerator {
|
|||
$NOVA_CONF_FILE = "/etc/nova/nova.conf"
|
||||
|
||||
exec { 'vcpu_pin':
|
||||
command => "crudini --set ${NOVA_CONF_FILE} DEFAULT vcpu_pin_set $(python /usr/local/bin/get_vcpu_pin_set.py)",
|
||||
} ->
|
||||
command => "crudini --set ${NOVA_CONF_FILE} DEFAULT vcpu_pin_set $(python /usr/local/bin/get_vcpu_pin_set.py)",
|
||||
notify => Service['virtual-accelerator'],
|
||||
}
|
||||
|
||||
service { 'virtual-accelerator':
|
||||
ensure => 'running',
|
||||
} ->
|
||||
exec { 'restart_ovs':
|
||||
command => 'service openvswitch-switch restart',
|
||||
} ->
|
||||
exec { 'restart_ovs_agent':
|
||||
command => 'service neutron-plugin-openvswitch-agent restart',
|
||||
} ->
|
||||
ensure => 'running',
|
||||
notify => Service['openvswitch-switch'],
|
||||
}
|
||||
|
||||
service { 'openvswitch-switch':
|
||||
ensure => 'running',
|
||||
notify => Service['neutron-plugin-openvswitch-agent'],
|
||||
}
|
||||
|
||||
service { 'neutron-plugin-openvswitch-agent':
|
||||
ensure => 'running',
|
||||
notify => Service['libvirt-bin'],
|
||||
}
|
||||
|
||||
service { 'libvirt-bin':
|
||||
ensure => 'stopped',
|
||||
} ->
|
||||
exec { 'restart_libvirt':
|
||||
command => 'service libvirtd restart',
|
||||
} ->
|
||||
exec { 'restart_nova':
|
||||
command => 'service nova-compute restart',
|
||||
ensure => 'stopped',
|
||||
notify => Service['libvirtd'],
|
||||
}
|
||||
|
||||
service { 'libvirtd':
|
||||
ensure => 'running',
|
||||
notify => Service['nova-compute'],
|
||||
}
|
||||
|
||||
service { 'nova-compute':
|
||||
ensure => 'running',
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue