Allow vhost socket directory user/group as configurable from template
For ovs2.8 version, it is required to modify the vhost socket directory permissions as openvswitch:hugetlbfs instead of the earlier hardcoded values qemu:qemu. Making these values as input which could be configured from templates. Change-Id: Ia2d0a49567f51b8e6ecdf1967c515ef0dfe81567
This commit is contained in:
@@ -27,10 +27,20 @@
|
|||||||
# (Optional) vhostuser socket dir, The directory where $vhostuser_socket_dir
|
# (Optional) vhostuser socket dir, The directory where $vhostuser_socket_dir
|
||||||
# will be created with correct permissions, inorder to support vhostuser
|
# will be created with correct permissions, inorder to support vhostuser
|
||||||
# client mode.
|
# client mode.
|
||||||
|
#
|
||||||
|
# [*vhostuser_socket_group*]
|
||||||
|
# (Optional) Group name for vhostuser socket dir.
|
||||||
|
# Defaults to qemu
|
||||||
|
#
|
||||||
|
# [*vhostuser_socket_user*]
|
||||||
|
# (Optional) User name for vhostuser socket dir.
|
||||||
|
# Defaults to qemu
|
||||||
|
|
||||||
class tripleo::profile::base::neutron::ovs(
|
class tripleo::profile::base::neutron::ovs(
|
||||||
$step = Integer(hiera('step')),
|
$step = Integer(hiera('step')),
|
||||||
$vhostuser_socket_dir = hiera('neutron::agents::ml2::ovs::vhostuser_socket_dir', undef)
|
$vhostuser_socket_dir = hiera('neutron::agents::ml2::ovs::vhostuser_socket_dir', undef),
|
||||||
|
$vhostuser_socket_group = hiera('vhostuser_socket_group', 'qemu'),
|
||||||
|
$vhostuser_socket_user = hiera('vhostuser_socket_user', 'qemu'),
|
||||||
) {
|
) {
|
||||||
include ::tripleo::profile::base::neutron
|
include ::tripleo::profile::base::neutron
|
||||||
|
|
||||||
@@ -38,8 +48,8 @@ class tripleo::profile::base::neutron::ovs(
|
|||||||
if $vhostuser_socket_dir {
|
if $vhostuser_socket_dir {
|
||||||
file { $vhostuser_socket_dir:
|
file { $vhostuser_socket_dir:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => 'qemu',
|
owner => $vhostuser_socket_user,
|
||||||
group => 'qemu',
|
group => $vhostuser_socket_group,
|
||||||
mode => '0775',
|
mode => '0775',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -58,6 +58,26 @@ describe 'tripleo::profile::base::neutron::ovs' do
|
|||||||
:mode => '0775',
|
:mode => '0775',
|
||||||
) }
|
) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with vhostuser_socketdir and its permissions configured' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:step => 5,
|
||||||
|
:vhostuser_socket_dir => '/var/lib/vhostuser_sockets',
|
||||||
|
:vhostuser_socket_group => 'hugetlbfs',
|
||||||
|
:vhostuser_socket_user => 'openvswitch'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_class('tripleo::profile::base::neutron') }
|
||||||
|
it { is_expected.to contain_class('neutron::agents::ml2::ovs') }
|
||||||
|
it { is_expected.to contain_file('/var/lib/vhostuser_sockets').with(
|
||||||
|
:ensure => 'directory',
|
||||||
|
:owner => 'openvswitch',
|
||||||
|
:group => 'hugetlbfs',
|
||||||
|
:mode => '0775',
|
||||||
|
) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
on_supported_os.each do |os, facts|
|
on_supported_os.each do |os, facts|
|
||||||
|
Reference in New Issue
Block a user