Several changes:
* `python-swiftclient` is now installed by default. * Fixed swift3. * Fixed s3token. * Recreated authtoken - it used to be configured in the Keystone module. * Created proxy-logging filter
This commit is contained in:
parent
87ab008565
commit
020b7723cb
manifests
templates/proxy
@ -33,6 +33,11 @@ class swift(
|
||||
ensure => $package_ensure,
|
||||
}
|
||||
|
||||
package { 'swiftclient':
|
||||
name => $::swift::params::client_package,
|
||||
ensure => $package_ensure,
|
||||
}
|
||||
|
||||
File { owner => 'swift', group => 'swift', require => Package['swift'] }
|
||||
|
||||
file { '/home/swift':
|
||||
|
@ -3,14 +3,18 @@ class swift::keystone::auth(
|
||||
$password = 'swift_password',
|
||||
$address = '127.0.0.1',
|
||||
$port = '8080',
|
||||
$tenant = 'services',
|
||||
$email = 'swift@localhost',
|
||||
$region = 'RegionOne'
|
||||
) {
|
||||
|
||||
keystone_user { $auth_name:
|
||||
ensure => present,
|
||||
password => $password,
|
||||
email => $email,
|
||||
tenant => $tenant,
|
||||
}
|
||||
keystone_user_role { "${auth_name}@services":
|
||||
keystone_user_role { "${auth_name}@${tenant}":
|
||||
ensure => present,
|
||||
roles => 'admin',
|
||||
require => Keystone_user[$auth_name]
|
||||
|
@ -2,6 +2,7 @@ class swift::params {
|
||||
case $osfamily {
|
||||
'Debian': {
|
||||
$package_name = 'swift'
|
||||
$client_package = 'python-swiftclient'
|
||||
$proxy_package_name = 'swift-proxy'
|
||||
$proxy_service_name = 'swift-proxy'
|
||||
$object_package_name = 'swift-object'
|
||||
@ -13,6 +14,7 @@ class swift::params {
|
||||
$account_package_name = 'swift-account'
|
||||
$account_service_name = 'swift-account'
|
||||
$account_replicator_service_name = 'swift-account-replicator'
|
||||
$swift3 = 'swift-plugin-s3'
|
||||
if $::operatingsystem == 'Debian' {
|
||||
$service_proivider = 'debian'
|
||||
} else {
|
||||
|
@ -32,25 +32,22 @@
|
||||
#
|
||||
|
||||
class swift::proxy::authtoken(
|
||||
$admin_token = undef,
|
||||
$admin_user = undef,
|
||||
$admin_tenant_name = undef,
|
||||
$admin_password = undef,
|
||||
$delay_auth_decision = undef,
|
||||
$auth_host = undef,
|
||||
$auth_port = undef,
|
||||
$auth_protocol = undef
|
||||
$admin_user = 'swift',
|
||||
$admin_tenant_name = 'services',
|
||||
$admin_password = 'password',
|
||||
$auth_host = '127.0.0.1',
|
||||
$auth_port = '35357',
|
||||
$auth_protocol = 'http',
|
||||
$delay_auth_decision = 1,
|
||||
$admin_token = false
|
||||
) {
|
||||
|
||||
keystone::client::authtoken { '/etc/swift/proxy-server.conf':
|
||||
admin_token => $admin_token,
|
||||
admin_user => $admin_user,
|
||||
admin_tenant_name => $admin_tenant_name,
|
||||
admin_password => $admin_password,
|
||||
delay_auth_decision => $delay_auth_decision,
|
||||
auth_host => $auth_host,
|
||||
auth_port => $auth_port,
|
||||
auth_protocol => $auth_protocol
|
||||
$auth_uri = "${auth_protocol}://${auth_host}:5000"
|
||||
$fragment_title = regsubst($name, '/', '_', 'G')
|
||||
|
||||
concat::fragment { "swift_authtoken":
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/authtoken.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
20
manifests/proxy/proxy-logging.pp
Normal file
20
manifests/proxy/proxy-logging.pp
Normal file
@ -0,0 +1,20 @@
|
||||
#
|
||||
# Configure swift proxy-logging.
|
||||
#
|
||||
# == Dependencies
|
||||
#
|
||||
# == Examples
|
||||
#
|
||||
# == Authors
|
||||
#
|
||||
# Joe Topjian joe@topjian.net
|
||||
#
|
||||
class swift::proxy::proxy-logging {
|
||||
|
||||
concat::fragment { 'swift_proxy-logging':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/proxy-logging.conf.erb'),
|
||||
order => '27',
|
||||
}
|
||||
|
||||
}
|
@ -23,7 +23,7 @@
|
||||
#
|
||||
class swift::proxy::s3token(
|
||||
auth_host = '127.0.0.1',
|
||||
auth_port = 5000,
|
||||
auth_port = '35357',
|
||||
auth_protocol = 'http'
|
||||
) {
|
||||
|
||||
|
@ -8,12 +8,22 @@
|
||||
# == Authors
|
||||
#
|
||||
# François Charlier fcharlier@ploup.net
|
||||
# Joe Topjian joe@topjian.net
|
||||
#
|
||||
# == Copyright
|
||||
#
|
||||
# Copyright 2012 eNovance licensing@enovance.com
|
||||
#
|
||||
class swift::proxy::swift3() {
|
||||
class swift::proxy::swift3(
|
||||
$ensure = 'present'
|
||||
) {
|
||||
|
||||
include $::swift::params
|
||||
|
||||
package { 'swift-plugin-s3':
|
||||
name => $::swift::params::swift3,
|
||||
ensure => $ensure,
|
||||
}
|
||||
|
||||
concat::fragment { 'swift_swift3':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
|
17
templates/proxy/authtoken.conf.erb
Normal file
17
templates/proxy/authtoken.conf.erb
Normal file
@ -0,0 +1,17 @@
|
||||
[filter:authtoken]
|
||||
paste.filter_factory = keystone.middleware.auth_token:filter_factory
|
||||
signing_dir = /etc/swift
|
||||
auth_host = <%= auth_host %>
|
||||
auth_port = <%= auth_port %>
|
||||
auth_protocol = <%= auth_protocol %>
|
||||
auth_uri = <%= auth_uri %>
|
||||
# if its defined
|
||||
<% if admin_token -%>
|
||||
admin_token = <%= admin_token %>
|
||||
<% else -%>
|
||||
admin_tenant_name = <%= admin_tenant_name %>
|
||||
admin_user = <%= admin_user %>
|
||||
admin_password = <%= admin_password %>
|
||||
<% end -%>
|
||||
delay_auth_decision = <%= delay_auth_decision %>
|
||||
|
3
templates/proxy/proxy-logging.conf.erb
Normal file
3
templates/proxy/proxy-logging.conf.erb
Normal file
@ -0,0 +1,3 @@
|
||||
[filter:proxy-logging]
|
||||
use = egg:swift#proxy_logging
|
||||
|
@ -1,3 +1,3 @@
|
||||
[filter:swift3]
|
||||
use = egg:swift#swift3
|
||||
use = egg:swift3#swift3
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user