diff --git a/manifests/params.pp b/manifests/params.pp index 6f5cb42..473b0bd 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -3,6 +3,8 @@ class glare::params { include ::openstacklib::defaults + $group = 'glare' + case $::osfamily { 'RedHat': { $glare_package_name = 'openstack-glare' diff --git a/manifests/policy.pp b/manifests/policy.pp index dc0b980..c3318ce 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -29,11 +29,14 @@ class glare::policy ( ) { include ::glare::deps + include ::glare::params validate_hash($policies) Openstacklib::Policy::Base { - file_path => $policy_path, + file_path => $policy_path, + file_user => 'root', + file_group => $::glare::params::group, } create_resources('openstacklib::policy::base', $policies) diff --git a/spec/classes/glare_policy_spec.rb b/spec/classes/glare_policy_spec.rb index 0615233..2038b55 100644 --- a/spec/classes/glare_policy_spec.rb +++ b/spec/classes/glare_policy_spec.rb @@ -1,7 +1,8 @@ require 'spec_helper' describe 'glare::policy' do - shared_examples_for 'glare-policies' do + + shared_examples_for 'glare policies' do let :params do { :policy_path => '/etc/glare/policy.json', @@ -16,8 +17,10 @@ describe 'glare::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 => 'glare', }) is_expected.to contain_oslo__policy('glare_config').with( :policy_file => '/etc/glare/policy.json', @@ -26,14 +29,14 @@ describe 'glare::policy' do end on_supported_os({ - :supported_os => OSDefaults.get_supported_os + :supported_os => OSDefaults.get_supported_os }).each do |os,facts| context "on #{os}" do let (:facts) do facts.merge!(OSDefaults.get_facts()) end - it_behaves_like 'glare-policies' + it_configures 'glare policies' end end end