diff --git a/manifests/policy.pp b/manifests/policy.pp index 195aba5d..b868d63b 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -20,12 +20,12 @@ # Defaults to empty hash. # # [*policy_path*] -# (Optional) Path to the ironic policy.json file -# Defaults to /etc/ironic/policy.json +# (Optional) Path to the ironic policy.yaml file +# Defaults to /etc/ironic/policy.yaml # class ironic::policy ( $policies = {}, - $policy_path = '/etc/ironic/policy.json', + $policy_path = '/etc/ironic/policy.yaml', ) { include ironic::deps @@ -34,9 +34,10 @@ class ironic::policy ( validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { - file_path => $policy_path, - file_user => 'root', - file_group => $::ironic::params::group, + file_path => $policy_path, + file_user => 'root', + file_group => $::ironic::params::group, + file_format => 'yaml', } create_resources('openstacklib::policy::base', $policies) diff --git a/releasenotes/notes/migrate-policy-format-from-json-to-yaml-83b54d0d4d5c503d.yaml b/releasenotes/notes/migrate-policy-format-from-json-to-yaml-83b54d0d4d5c503d.yaml new file mode 100644 index 00000000..fd7e1a85 --- /dev/null +++ b/releasenotes/notes/migrate-policy-format-from-json-to-yaml-83b54d0d4d5c503d.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Now policy.yaml is used by default instead of policy.json. diff --git a/spec/classes/ironic_policy_spec.rb b/spec/classes/ironic_policy_spec.rb index 07923def..76970a2d 100644 --- a/spec/classes/ironic_policy_spec.rb +++ b/spec/classes/ironic_policy_spec.rb @@ -5,7 +5,7 @@ describe 'ironic::policy' do shared_examples_for 'ironic policies' do let :params do { - :policy_path => '/etc/ironic/policy.json', + :policy_path => '/etc/ironic/policy.yaml', :policies => { 'context_is_admin' => { 'key' => 'context_is_admin', @@ -17,13 +17,14 @@ describe 'ironic::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 => 'ironic', + :key => 'context_is_admin', + :value => 'foo:bar', + :file_user => 'root', + :file_group => 'ironic', + :file_format => 'yaml', }) is_expected.to contain_oslo__policy('ironic_config').with( - :policy_file => '/etc/ironic/policy.json', + :policy_file => '/etc/ironic/policy.yaml', ) end end