diff --git a/manifests/policy.pp b/manifests/policy.pp index 85091c087..8759a740d 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -20,12 +20,12 @@ # Defaults to empty hash. # # [*policy_path*] -# (Optional) Path to the neutron policy.json file -# Defaults to /etc/neutron/policy.json +# (Optional) Path to the neutron policy.yaml file +# Defaults to /etc/neutron/policy.yaml # class neutron::policy ( $policies = {}, - $policy_path = '/etc/neutron/policy.json', + $policy_path = '/etc/neutron/policy.yaml', ) { include neutron::deps @@ -34,9 +34,10 @@ class neutron::policy ( validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { - file_path => $policy_path, - file_user => 'root', - file_group => $::neutron::params::group, + file_path => $policy_path, + file_user => 'root', + file_group => $::neutron::params::group, + file_format => 'yaml', } create_resources('openstacklib::policy::base', $policies) diff --git a/releasenotes/notes/migrate-policy-format-from-json-to-yaml-2e6b1119f65a99ff.yaml b/releasenotes/notes/migrate-policy-format-from-json-to-yaml-2e6b1119f65a99ff.yaml new file mode 100644 index 000000000..fd7e1a851 --- /dev/null +++ b/releasenotes/notes/migrate-policy-format-from-json-to-yaml-2e6b1119f65a99ff.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Now policy.yaml is used by default instead of policy.json. diff --git a/spec/classes/neutron_policy_spec.rb b/spec/classes/neutron_policy_spec.rb index 5e7c8cbab..53f97a769 100644 --- a/spec/classes/neutron_policy_spec.rb +++ b/spec/classes/neutron_policy_spec.rb @@ -4,7 +4,7 @@ describe 'neutron::policy' do shared_examples 'neutron policies' do let :params do { - :policy_path => '/etc/neutron/policy.json', + :policy_path => '/etc/neutron/policy.yaml', :policies => { 'context_is_admin' => { 'key' => 'context_is_admin', @@ -16,13 +16,14 @@ describe 'neutron::policy' do it 'set up the policies' do should contain_openstacklib__policy__base('context_is_admin').with({ - :key => 'context_is_admin', - :value => 'foo:bar', - :file_user => 'root', - :file_group => 'neutron', + :key => 'context_is_admin', + :value => 'foo:bar', + :file_user => 'root', + :file_group => 'neutron', + :file_format => 'yaml', }) should contain_oslo__policy('neutron_config').with( - :policy_file => '/etc/neutron/policy.json', + :policy_file => '/etc/neutron/policy.yaml', ) end end