Add group to policy management

The move of policy.json into code means the file may not exist. We've
added support to ensure that the file exists in the openstacklib but we
need to make sure the permissions are right for each service. This adds
the group information to the policies so it works right.

Depends-On: I26e8b1384f4f69712da9d06a4c565dfd1f17c9ed
Change-Id: I924b9390e8b0667ee1173895fc40e5f0d9a1f373
Co-Authored-By: Alex Schultz <aschultz@redhat.com>
This commit is contained in:
Emilien Macchi 2018-01-10 14:10:08 -08:00
parent ae090c9ffe
commit 8759b23e33
3 changed files with 9 additions and 15 deletions

View File

@ -38,6 +38,7 @@ class neutron::params {
$nsx_plugin_package = 'vmware-nsx'
$nsx_config_file = '/etc/neutron/plugins/vmware/nsx.ini'
$sfc_package = 'python-networking-sfc'
$group = 'neutron'
if($::osfamily == 'Redhat') {
$nobody_user_group = 'nobody'

View File

@ -29,13 +29,14 @@ class neutron::policy (
) {
include ::neutron::deps
include ::neutron::params
validate_hash($policies)
Openstacklib::Policy::Base {
file_path => $policy_path,
require => Anchor['neutron::config::begin'],
notify => Anchor['neutron::config::end'],
file_path => $policy_path,
file_user => 'root',
file_group => $::neutron::params::group,
}
create_resources('openstacklib::policy::base', $policies)

View File

@ -2,12 +2,6 @@ require 'spec_helper'
describe 'neutron::policy' do
let :test_facts do
{ :operatingsystem => 'default',
:operatingsystemrelease => 'default'
}
end
shared_examples_for 'neutron policies' do
let :params do
{
@ -23,12 +17,11 @@ describe 'neutron::policy' do
it 'set up the policies' do
is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
:key => 'context_is_admin',
:value => 'foo:bar'
:key => 'context_is_admin',
:value => 'foo:bar',
:file_user => 'root',
:file_group => 'neutron',
})
end
it 'set policy_file in neutron.conf' do
is_expected.to contain_oslo__policy('neutron_config').with(
:policy_file => '/etc/neutron/policy.json',
)
@ -46,5 +39,4 @@ describe 'neutron::policy' do
it_configures 'neutron policies'
end
end
end