diff --git a/manifests/policy.pp b/manifests/policy.pp index 80ce0ef2..a86d6353 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/octavia/policy.json +# (Optional) Path to the octavia policy.yaml file +# Defaults to /etc/octavia/policy.yaml # class octavia::policy ( $policies = {}, - $policy_path = '/etc/octavia/policy.json', + $policy_path = '/etc/octavia/policy.yaml', ) { include octavia::deps @@ -34,9 +34,10 @@ class octavia::policy ( validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { - file_path => $policy_path, - file_user => 'root', - file_group => $::octavia::params::group, + file_path => $policy_path, + file_user => 'root', + file_group => $::octavia::params::group, + file_format => 'yaml', } create_resources('openstacklib::policy::base', $policies) diff --git a/releasenotes/notes/change-oslo-policy-to-yaml-e4efbaeafa2fbb1c.yaml b/releasenotes/notes/change-oslo-policy-to-yaml-e4efbaeafa2fbb1c.yaml new file mode 100644 index 00000000..9c9f2ed8 --- /dev/null +++ b/releasenotes/notes/change-oslo-policy-to-yaml-e4efbaeafa2fbb1c.yaml @@ -0,0 +1,3 @@ +--- +fixes: + - Octavia switched oslo.policy from JSON to YAML format output. diff --git a/spec/classes/octavia_policy_spec.rb b/spec/classes/octavia_policy_spec.rb index 2896f446..4f8d172a 100644 --- a/spec/classes/octavia_policy_spec.rb +++ b/spec/classes/octavia_policy_spec.rb @@ -5,7 +5,7 @@ describe 'octavia::policy' do shared_examples_for 'octavia policies' do let :params do { - :policy_path => '/etc/octavia/policy.json', + :policy_path => '/etc/octavia/policy.yaml', :policies => { 'context_is_admin' => { 'key' => 'context_is_admin', @@ -17,13 +17,14 @@ describe 'octavia::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 => 'octavia', + :key => 'context_is_admin', + :value => 'foo:bar', + :file_user => 'root', + :file_group => 'octavia', + :file_format => 'yaml', }) is_expected.to contain_oslo__policy('octavia_config').with( - :policy_file => '/etc/octavia/policy.json', + :policy_file => '/etc/octavia/policy.yaml', ) end end