Fix auth_token configuration.
- cache=swift.cache need to be in auth_token configuration not in keystoneauth. - Make auth_token using the same facility for logging than main swift. Closes-Bug: #1254487 Change-Id: If5a09da4d18f247dc42b99e6f666bc2867d06dcb
This commit is contained in:

committed by
Emilien Macchi

parent
3566f9fa65
commit
000d63b654
@@ -29,6 +29,8 @@
|
|||||||
# Should be set to your public keystone endpoint (without version).
|
# Should be set to your public keystone endpoint (without version).
|
||||||
# [signing_dir] The cache directory for signing certificates.
|
# [signing_dir] The cache directory for signing certificates.
|
||||||
# Defaults to '/var/cache/swift'
|
# Defaults to '/var/cache/swift'
|
||||||
|
# [cache] the cache backend to use
|
||||||
|
# Optional. Defaults to 'swift.cache'
|
||||||
#
|
#
|
||||||
# == Authors
|
# == Authors
|
||||||
#
|
#
|
||||||
@@ -50,7 +52,8 @@ class swift::proxy::authtoken(
|
|||||||
$auth_uri = false,
|
$auth_uri = false,
|
||||||
$delay_auth_decision = 1,
|
$delay_auth_decision = 1,
|
||||||
$admin_token = false,
|
$admin_token = false,
|
||||||
$signing_dir = '/var/cache/swift'
|
$signing_dir = '/var/cache/swift',
|
||||||
|
$cache = 'swift.cache'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if $auth_uri {
|
if $auth_uri {
|
||||||
|
@@ -8,8 +8,6 @@
|
|||||||
# Must be an array of strings
|
# Must be an array of strings
|
||||||
# [is_admin] Set to true to allow users to set ACLs on their account.
|
# [is_admin] Set to true to allow users to set ACLs on their account.
|
||||||
# Optional. Defaults to true.
|
# Optional. Defaults to true.
|
||||||
# [cache] the cache backend to use
|
|
||||||
# Optional. Defaults to 'swift.cache'
|
|
||||||
#
|
#
|
||||||
# == Authors
|
# == Authors
|
||||||
#
|
#
|
||||||
@@ -19,8 +17,7 @@
|
|||||||
|
|
||||||
class swift::proxy::keystone(
|
class swift::proxy::keystone(
|
||||||
$operator_roles = ['admin', 'SwiftOperator'],
|
$operator_roles = ['admin', 'SwiftOperator'],
|
||||||
$is_admin = true,
|
$is_admin = true
|
||||||
$cache = 'swift.cache'
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
concat::fragment { 'swift_keystone':
|
concat::fragment { 'swift_keystone':
|
||||||
|
@@ -37,6 +37,7 @@ describe 'swift::proxy::authtoken' do
|
|||||||
verify_contents(subject, fragment_file,
|
verify_contents(subject, fragment_file,
|
||||||
[
|
[
|
||||||
'[filter:authtoken]',
|
'[filter:authtoken]',
|
||||||
|
'log_name = swift',
|
||||||
'signing_dir = /var/cache/swift',
|
'signing_dir = /var/cache/swift',
|
||||||
'paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory',
|
'paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory',
|
||||||
'auth_host = 127.0.0.1',
|
'auth_host = 127.0.0.1',
|
||||||
@@ -47,6 +48,7 @@ describe 'swift::proxy::authtoken' do
|
|||||||
'admin_user = swift',
|
'admin_user = swift',
|
||||||
'admin_password = password',
|
'admin_password = password',
|
||||||
'delay_auth_decision = 1',
|
'delay_auth_decision = 1',
|
||||||
|
'cache = swift.cache',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@@ -63,6 +65,7 @@ describe 'swift::proxy::authtoken' do
|
|||||||
verify_contents(subject, fragment_file,
|
verify_contents(subject, fragment_file,
|
||||||
[
|
[
|
||||||
'[filter:authtoken]',
|
'[filter:authtoken]',
|
||||||
|
'log_name = swift',
|
||||||
'signing_dir = /var/cache/swift',
|
'signing_dir = /var/cache/swift',
|
||||||
'paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory',
|
'paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory',
|
||||||
'auth_host = 127.0.0.1',
|
'auth_host = 127.0.0.1',
|
||||||
@@ -71,6 +74,7 @@ describe 'swift::proxy::authtoken' do
|
|||||||
'auth_uri = http://127.0.0.1:5000',
|
'auth_uri = http://127.0.0.1:5000',
|
||||||
'admin_token = ADMINTOKEN',
|
'admin_token = ADMINTOKEN',
|
||||||
'delay_auth_decision = 1',
|
'delay_auth_decision = 1',
|
||||||
|
'cache = swift.cache',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@@ -86,6 +90,7 @@ describe 'swift::proxy::authtoken' do
|
|||||||
:admin_tenant_name => 'admin',
|
:admin_tenant_name => 'admin',
|
||||||
:admin_user => 'swiftuser',
|
:admin_user => 'swiftuser',
|
||||||
:admin_password => 'swiftpassword',
|
:admin_password => 'swiftpassword',
|
||||||
|
:cache => 'foo',
|
||||||
:delay_auth_decision => '0',
|
:delay_auth_decision => '0',
|
||||||
:signing_dir => '/home/swift/keystone-signing'
|
:signing_dir => '/home/swift/keystone-signing'
|
||||||
}
|
}
|
||||||
@@ -95,6 +100,7 @@ describe 'swift::proxy::authtoken' do
|
|||||||
verify_contents(subject, fragment_file,
|
verify_contents(subject, fragment_file,
|
||||||
[
|
[
|
||||||
'[filter:authtoken]',
|
'[filter:authtoken]',
|
||||||
|
'log_name = swift',
|
||||||
'signing_dir = /home/swift/keystone-signing',
|
'signing_dir = /home/swift/keystone-signing',
|
||||||
'paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory',
|
'paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory',
|
||||||
'auth_host = some.host',
|
'auth_host = some.host',
|
||||||
@@ -106,6 +112,7 @@ describe 'swift::proxy::authtoken' do
|
|||||||
'admin_user = swiftuser',
|
'admin_user = swiftuser',
|
||||||
'admin_password = swiftpassword',
|
'admin_password = swiftpassword',
|
||||||
'delay_auth_decision = 0',
|
'delay_auth_decision = 0',
|
||||||
|
'cache = foo',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@@ -27,7 +27,6 @@ describe 'swift::proxy::keystone' do
|
|||||||
|
|
||||||
it { should contain_file(fragment_file).with_content(/operator_roles = admin, SwiftOperator/) }
|
it { should contain_file(fragment_file).with_content(/operator_roles = admin, SwiftOperator/) }
|
||||||
it { should contain_file(fragment_file).with_content(/is_admin = true/) }
|
it { should contain_file(fragment_file).with_content(/is_admin = true/) }
|
||||||
it { should contain_file(fragment_file).with_content(/cache = swift.cache/) }
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -37,12 +36,10 @@ describe 'swift::proxy::keystone' do
|
|||||||
{
|
{
|
||||||
:operator_roles => 'foo',
|
:operator_roles => 'foo',
|
||||||
:is_admin => 'false',
|
:is_admin => 'false',
|
||||||
:cache => 'somecache'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it { should contain_file(fragment_file).with_content(/operator_roles = foo/) }
|
it { should contain_file(fragment_file).with_content(/operator_roles = foo/) }
|
||||||
it { should contain_file(fragment_file).with_content(/is_admin = false/) }
|
it { should contain_file(fragment_file).with_content(/is_admin = false/) }
|
||||||
it { should contain_file(fragment_file).with_content(/cache = somecache/) }
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
[filter:authtoken]
|
[filter:authtoken]
|
||||||
|
log_name = swift
|
||||||
signing_dir = <%= @signing_dir %>
|
signing_dir = <%= @signing_dir %>
|
||||||
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
|
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
|
||||||
auth_host = <%= @auth_host %>
|
auth_host = <%= @auth_host %>
|
||||||
@@ -17,4 +18,4 @@ admin_user = <%= @admin_user %>
|
|||||||
admin_password = <%= @admin_password %>
|
admin_password = <%= @admin_password %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
delay_auth_decision = <%= @delay_auth_decision %>
|
delay_auth_decision = <%= @delay_auth_decision %>
|
||||||
|
cache = <%= @cache %>
|
||||||
|
@@ -3,5 +3,3 @@
|
|||||||
use = egg:swift#keystoneauth
|
use = egg:swift#keystoneauth
|
||||||
operator_roles = <%= @operator_roles.to_a.join(', ') %>
|
operator_roles = <%= @operator_roles.to_a.join(', ') %>
|
||||||
is_admin = <%= @is_admin %>
|
is_admin = <%= @is_admin %>
|
||||||
cache = <%= @cache %>
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user