diff --git a/manifests/policy.pp b/manifests/policy.pp index 111b3ff56..c86989a1a 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -24,13 +24,13 @@ # Defaults to empty hash. # # [*policy_path*] -# (Optional) Path to the nova policy.json file -# Defaults to /etc/keystone/policy.json +# (Optional) Path to the nova policy.yaml file +# Defaults to /etc/keystone/policy.yaml # class keystone::policy ( $enforce_scope = $::os_service_default, $policies = {}, - $policy_path = '/etc/keystone/policy.json', + $policy_path = '/etc/keystone/policy.yaml', ) { include keystone::deps @@ -39,9 +39,10 @@ class keystone::policy ( validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { - file_path => $policy_path, - file_user => 'root', - file_group => $::keystone::params::group, + file_path => $policy_path, + file_user => 'root', + file_group => $::keystone::params::group, + file_format => 'yaml', } create_resources('openstacklib::policy::base', $policies) diff --git a/releasenotes/notes/migrate-policy-format-from-json-to-yaml-be47196f7a608760.yaml b/releasenotes/notes/migrate-policy-format-from-json-to-yaml-be47196f7a608760.yaml new file mode 100644 index 000000000..fd7e1a851 --- /dev/null +++ b/releasenotes/notes/migrate-policy-format-from-json-to-yaml-be47196f7a608760.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Now policy.yaml is used by default instead of policy.json. diff --git a/spec/classes/keystone_policy_spec.rb b/spec/classes/keystone_policy_spec.rb index abcd6c0f2..1dafd9cde 100644 --- a/spec/classes/keystone_policy_spec.rb +++ b/spec/classes/keystone_policy_spec.rb @@ -5,7 +5,7 @@ describe 'keystone::policy' do let :params do { :enforce_scope => false, - :policy_path => '/etc/keystone/policy.json', + :policy_path => '/etc/keystone/policy.yaml', :policies => { 'context_is_admin' => { 'key' => 'context_is_admin', @@ -17,14 +17,15 @@ describe 'keystone::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', - :file_user => 'root', - :file_group => 'keystone', + :key => 'context_is_admin', + :value => 'foo:bar', + :file_user => 'root', + :file_group => 'keystone', + :file_format => 'yaml', }) is_expected.to contain_oslo__policy('keystone_config').with( :enforce_scope => false, - :policy_file => '/etc/keystone/policy.json', + :policy_file => '/etc/keystone/policy.yaml', ) end end