diff --git a/manifests/policy.pp b/manifests/policy.pp index 70aaddc..49332f0 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -20,12 +20,12 @@ # Defaults to empty hash. # # [*policy_path*] -# (Optional) Path to the nova policy.json file -# Defaults to /etc/mistral/policy.json +# (Optional) Path to the nova policy.yaml file +# Defaults to /etc/mistral/policy.yaml # class mistral::policy ( $policies = {}, - $policy_path = '/etc/mistral/policy.json', + $policy_path = '/etc/mistral/policy.yaml', ) { include mistral::deps @@ -34,9 +34,10 @@ class mistral::policy ( validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { - file_path => $policy_path, - file_user => 'root', - file_group => $::mistral::params::group, + file_path => $policy_path, + file_user => 'root', + file_group => $::mistral::params::group, + file_format => 'yaml', } create_resources('openstacklib::policy::base', $policies) diff --git a/releasenotes/notes/migrate-policy-format-from-json-to-yaml-8a43ac1cf4d5ea54.yaml b/releasenotes/notes/migrate-policy-format-from-json-to-yaml-8a43ac1cf4d5ea54.yaml new file mode 100644 index 0000000..fd7e1a8 --- /dev/null +++ b/releasenotes/notes/migrate-policy-format-from-json-to-yaml-8a43ac1cf4d5ea54.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Now policy.yaml is used by default instead of policy.json. diff --git a/spec/classes/mistral_policy_spec.rb b/spec/classes/mistral_policy_spec.rb index 40e3802..f8a404a 100644 --- a/spec/classes/mistral_policy_spec.rb +++ b/spec/classes/mistral_policy_spec.rb @@ -5,7 +5,7 @@ describe 'mistral::policy' do shared_examples_for 'mistral policies' do let :params do { - :policy_path => '/etc/mistral/policy.json', + :policy_path => '/etc/mistral/policy.yaml', :policies => { 'context_is_admin' => { 'key' => 'context_is_admin', @@ -17,13 +17,14 @@ describe 'mistral::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 => 'mistral', + :key => 'context_is_admin', + :value => 'foo:bar', + :file_user => 'root', + :file_group => 'mistral', + :file_format => 'yaml', }) is_expected.to contain_oslo__policy('mistral_config').with( - :policy_file => '/etc/mistral/policy.json', + :policy_file => '/etc/mistral/policy.yaml', ) end end