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 Related-Bug: #1742154 Change-Id: I10b322d05042fdef23758d46906cf57aa9def97f
This commit is contained in:
parent
d7796e934b
commit
bdd660ccdb
@ -6,6 +6,7 @@ class zaqar::params {
|
|||||||
include ::openstacklib::defaults
|
include ::openstacklib::defaults
|
||||||
|
|
||||||
$client_package_name = 'python-zaqarclient'
|
$client_package_name = 'python-zaqarclient'
|
||||||
|
$group = 'zaqar'
|
||||||
|
|
||||||
case $::osfamily {
|
case $::osfamily {
|
||||||
'RedHat': {
|
'RedHat': {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
# Defaults to empty hash.
|
# Defaults to empty hash.
|
||||||
#
|
#
|
||||||
# [*policy_path*]
|
# [*policy_path*]
|
||||||
# (optional) Path to the nova policy.json file
|
# (optional) Path to the zaqar policy.json file
|
||||||
# Defaults to /etc/zaqar/policy.json
|
# Defaults to /etc/zaqar/policy.json
|
||||||
#
|
#
|
||||||
class zaqar::policy (
|
class zaqar::policy (
|
||||||
@ -29,11 +29,14 @@ class zaqar::policy (
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
include ::zaqar::deps
|
include ::zaqar::deps
|
||||||
|
include ::zaqar::params
|
||||||
|
|
||||||
validate_hash($policies)
|
validate_hash($policies)
|
||||||
|
|
||||||
Openstacklib::Policy::Base {
|
Openstacklib::Policy::Base {
|
||||||
file_path => $policy_path,
|
file_path => $policy_path,
|
||||||
|
file_user => 'root',
|
||||||
|
file_group => $::zaqar::params::group,
|
||||||
}
|
}
|
||||||
|
|
||||||
create_resources('openstacklib::policy::base', $policies)
|
create_resources('openstacklib::policy::base', $policies)
|
||||||
|
@ -17,8 +17,10 @@ describe 'zaqar::policy' do
|
|||||||
|
|
||||||
it 'set up the policies' do
|
it 'set up the policies' do
|
||||||
is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
|
is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
|
||||||
:key => 'context_is_admin',
|
:key => 'context_is_admin',
|
||||||
:value => 'foo:bar'
|
:value => 'foo:bar',
|
||||||
|
:file_user => 'root',
|
||||||
|
:file_group => 'zaqar',
|
||||||
})
|
})
|
||||||
is_expected.to contain_oslo__policy('zaqar_config').with(
|
is_expected.to contain_oslo__policy('zaqar_config').with(
|
||||||
:policy_file => '/etc/zaqar/policy.json',
|
:policy_file => '/etc/zaqar/policy.json',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user