19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# File 'manifests/object/controller.pp', line 19
class cloud::object::controller(
$ks_keystone_admin_host = $os_params::ks_keystone_admin_host,
$ks_keystone_admin_port = $os_params::ks_keystone_admin_port,
$ks_keystone_internal_host = $os_params::ks_keystone_internal_host,
$ks_keystone_internal_port = $os_params::ks_keystone_internal_port,
$ks_swift_dispersion_password = $os_params::ks_swift_dispersion_password,
$ks_swift_internal_port = $os_params::ks_swift_internal_port,
$ks_swift_password = $os_params::ks_swift_password,
$statsd_host = $os_params::statsd_host,
$statsd_port = $os_params::statsd_port,
$memcache_servers = $os_params::memcache_servers,
$api_eth = $os_params::api_eth,
) {
include 'cloud::object'
class { 'swift::proxy':
proxy_local_net_ip => $api_eth,
port => $ks_swift_internal_port,
pipeline => [
#'catch_errors', 'healthcheck', 'cache', 'bulk', 'ratelimit',
'catch_errors', 'healthcheck', 'cache', 'ratelimit',
#'swift3', 's3token', 'container_quotas', 'account_quotas', 'tempurl',
'swift3', 's3token', 'tempurl',
'formpost', 'staticweb', 'ceilometer', 'authtoken', 'keystone',
'proxy-logging', 'proxy-server'],
account_autocreate => true,
log_level => 'DEBUG',
workers => inline_template('<%= @processorcount.to_i * 2 %>
cors_allow_origin = <%= scope.lookupvar("swift_cors_allow_origin") %>
log_statsd_host = <%= scope.lookupvar("statsd_host") %>
log_statsd_port = <%= scope.lookupvar("statsd_port") %>
log_statsd_default_sample_rate = 1
'),
}
class{'swift::proxy::cache':
memcache_servers => inline_template(
'<%= scope.lookupvar("memcache_servers").join(",") %>'),
}
class { 'swift::proxy::proxy-logging': }
class { 'swift::proxy::healthcheck': }
class { 'swift::proxy::catch_errors': }
class { 'swift::proxy::ratelimit': }
#class { 'swift::proxy::account_quotas': }
#class { 'swift::proxy::container_quotas': }
#class { 'swift::proxy::bulk': }
class { 'swift::proxy::staticweb': }
class { 'swift::proxy::ceilometer': }
class { 'swift::proxy::keystone':
operator_roles => ['admin', 'SwiftOperator', 'ResellerAdmin'],
}
class { 'swift::proxy::tempurl': }
class { 'swift::proxy::formpost': }
class { 'swift::proxy::authtoken':
admin_password => $ks_swift_password,
auth_host => $ks_keystone_admin_host,
auth_port => $ks_keystone_admin_port,
delay_auth_decision => inline_template('1
cache = swift.cache')
}
class { 'swift::proxy::swift3':
ensure => 'latest',
}
class { 'swift::proxy::s3token':
auth_host => $ks_keystone_admin_host,
auth_port => $ks_keystone_admin_port,
}
class { 'swift::dispersion':
auth_url => "http://${ks_keystone_internal_host}:${ks_keystone_internal_port}/v2.0",
swift_dir => '/etc/swift',
auth_pass => $ks_swift_dispersion_password,
endpoint_type => 'internalURL'
}
# Note(sileht): log file should exists to swift proxy to write to
# the ceilometer directory
file{'/var/log/ceilometer/swift-proxy-server.log':
ensure => present,
owner => 'swift',
group => 'swift',
notify => Service['swift-proxy']
}
Swift::Ringsync<<| |>> #~> Service["swift-proxy"]
@@haproxy::balancermember{"${::fqdn}-swift_api":
listening_service => 'swift_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_swift_internal_port,
options => 'check inter 2000 rise 2 fall 5'
}
}
|