Renamed attributes and references described in blueprint

Implements: blueprint object-storage-attribute-rename

Change-Id: Iac4ea45d1894b14da2656f4f525d1a87784fcdfd
This commit is contained in:
Simon Ingelsson
2014-02-24 16:58:33 +01:00
parent 437596eaf8
commit 715eddffba
28 changed files with 278 additions and 273 deletions

View File

@@ -4,16 +4,16 @@
# node/ring settings
#--------------------
default['swift']['state'] = {}
default['swift']['swift_hash'] = '107c0568ea84'
default['swift']['audit_hour'] = '5'
default['swift']['disk_enum_expr'] = 'node[:block_device]'
default['swift']['auto_rebuild_rings'] = false
default['swift']['git_builder_ip'] = '127.0.0.1'
default['openstack']['object-storage']['state'] = {}
default['openstack']['object-storage']['swift_hash'] = '107c0568ea84'
default['openstack']['object-storage']['audit_hour'] = '5'
default['openstack']['object-storage']['disk_enum_expr'] = 'node[:block_device]'
default['openstack']['object-storage']['auto_rebuild_rings'] = false
default['openstack']['object-storage']['git_builder_ip'] = '127.0.0.1'
# the release only has any effect on ubuntu, and must be
# a valid release on http://ubuntu-cloud.archive.canonical.com/ubuntu
default['swift']['release'] = 'havana'
default['openstack']['object-storage']['release'] = 'havana'
# we support an optional secret databag where we will retrieve the
# following attributes overriding any default attributes here
@@ -25,48 +25,48 @@ default['swift']['release'] = 'havana'
# "dispersion_auth_user": "test:test",
# "dispersion_auth_key": "test"
# }
default['swift']['swift_secret_databag_name'] = nil
default['openstack']['object-storage']['swift_secret_databag_name'] = nil
#--------------------
# roles
#--------------------
default['swift']['setup_chef_role'] = 'swift-setup'
default['swift']['management_server_chef_role'] = 'swift-management-server'
default['swift']['proxy_server_chef_role'] = 'swift-proxy-server'
default['swift']['object_server_chef_role'] = 'swift-object-server'
default['swift']['account_server_chef_role'] = 'swift-account-server'
default['swift']['container_server_chef_role'] = 'swift-container-server'
default['openstack']['object-storage']['setup_chef_role'] = 'swift-setup'
default['openstack']['object-storage']['management_server_chef_role'] = 'swift-management-server'
default['openstack']['object-storage']['proxy_server_chef_role'] = 'swift-proxy-server'
default['openstack']['object-storage']['object_server_chef_role'] = 'swift-object-server'
default['openstack']['object-storage']['account_server_chef_role'] = 'swift-account-server'
default['openstack']['object-storage']['container_server_chef_role'] = 'swift-container-server'
#--------------------
# authentication
#--------------------
default['swift']['authmode'] = 'swauth'
default['swift']['authkey'] = 'test'
default['swift']['swift_url'] = 'http://127.0.0.1:8080/v1/'
default['swift']['swauth_url'] = 'http://127.0.0.1:8080/v1/'
default['swift']['auth_url'] = 'http://127.0.0.1:8080/auth/v1.0'
default['openstack']['object-storage']['authmode'] = 'swauth'
default['openstack']['object-storage']['authkey'] = 'test'
default['openstack']['object-storage']['swift_url'] = 'http://127.0.0.1:8080/v1/'
default['openstack']['object-storage']['swauth_url'] = 'http://127.0.0.1:8080/v1/'
default['openstack']['object-storage']['auth_url'] = 'http://127.0.0.1:8080/auth/v1.0'
#---------------------
# dispersion settings
#---------------------
default['swift']['dispersion']['auth_user'] = 'test:test'
default['swift']['dispersion']['auth_key'] = 'test'
default['openstack']['object-storage']['dispersion']['auth_user'] = 'test:test'
default['openstack']['object-storage']['dispersion']['auth_key'] = 'test'
# settings for the swift ring - these default settings are
# a safe setting for testing but part_power should be set to
# 26 in production to allow a swift cluster with 50,000 spindles
default['swift']['ring']['part_power'] = 18
default['swift']['ring']['min_part_hours'] = 1
default['swift']['ring']['replicas'] = 3
default['openstack']['object-storage']['ring']['part_power'] = 18
default['openstack']['object-storage']['ring']['min_part_hours'] = 1
default['openstack']['object-storage']['ring']['replicas'] = 3
#------------------
# statistics
#------------------
default['swift']['statistics']['enabled'] = true
default['swift']['statistics']['sample_rate'] = 1
default['openstack']['object-storage']['statistics']['enabled'] = true
default['openstack']['object-storage']['statistics']['sample_rate'] = 1
# there are two ways to discover your graphite server ip for
# statsd to periodically publish to. You can directly set
@@ -76,29 +76,29 @@ default['swift']['statistics']['sample_rate'] = 1
#
# if no servers with the role below can be found then
# 127.0.0.1 will be used
default['swift']['statistics']['graphing_ip'] = nil
default['swift']['statistics']['graphing_role'] = 'graphite-role'
default['swift']['statistics']['graphing_interface'] = 'eth0'
default['openstack']['object-storage']['statistics']['graphing_ip'] = nil
default['openstack']['object-storage']['statistics']['graphing_role'] = 'graphite-role'
default['openstack']['object-storage']['statistics']['graphing_interface'] = 'eth0'
# how frequently to run chef instantiated /usr/local/bin/swift_statsd_publish.py
# which publishes dispersion and recon statistics (in minutes)
default['swift']['statistics']['report_frequency'] = 15
default['openstack']['object-storage']['statistics']['report_frequency'] = 15
# enable or disable specific portions of generated report
default['swift']['statistics']['enable_dispersion_report'] = true
default['swift']['statistics']['enable_recon_report'] = true
default['swift']['statistics']['enable_disk_report'] = true
default['openstack']['object-storage']['statistics']['enable_dispersion_report'] = true
default['openstack']['object-storage']['statistics']['enable_recon_report'] = true
default['openstack']['object-storage']['statistics']['enable_disk_report'] = true
# settings for statsd which should be configured to use the local
# statsd daemon that chef will install if statistics are enabled
default['swift']['statistics']['statsd_host'] = '127.0.0.1'
default['swift']['statistics']['statsd_port'] = '8125'
default['swift']['statistics']['statsd_prefix'] = 'openstack.swift'
default['openstack']['object-storage']['statistics']['statsd_host'] = '127.0.0.1'
default['openstack']['object-storage']['statistics']['statsd_port'] = '8125'
default['openstack']['object-storage']['statistics']['statsd_prefix'] = 'openstack.swift'
# paths to the recon cache files
default['swift']['statistics']['recon_account_cache'] = '/var/cache/swift/account.recon'
default['swift']['statistics']['recon_container_cache'] = '/var/cache/swift/container.recon'
default['swift']['statistics']['recon_object_cache'] = '/var/cache/swift/object.recon'
default['openstack']['object-storage']['statistics']['recon_account_cache'] = '/var/cache/swift/account.recon'
default['openstack']['object-storage']['statistics']['recon_container_cache'] = '/var/cache/swift/container.recon'
default['openstack']['object-storage']['statistics']['recon_object_cache'] = '/var/cache/swift/object.recon'
#------------------
# network settings
@@ -111,22 +111,22 @@ default['swift']['statistics']['recon_object_cache'] = '/var/cache/swift/object.
# communication
# proxy servers
default['swift']['network']['proxy-bind-ip'] = '0.0.0.0'
default['swift']['network']['proxy-bind-port'] = '8080'
default['swift']['network']['proxy-cidr'] = '10.0.0.0/24'
default['openstack']['object-storage']['network']['proxy-bind-ip'] = '0.0.0.0'
default['openstack']['object-storage']['network']['proxy-bind-port'] = '8080'
default['openstack']['object-storage']['network']['proxy-cidr'] = '10.0.0.0/24'
# account servers
default['swift']['network']['account-bind-ip'] = '0.0.0.0'
default['swift']['network']['account-bind-port'] = '6002'
default['openstack']['object-storage']['network']['account-bind-ip'] = '0.0.0.0'
default['openstack']['object-storage']['network']['account-bind-port'] = '6002'
# container servers
default['swift']['network']['container-bind-ip'] = '0.0.0.0'
default['swift']['network']['container-bind-port'] = '6001'
default['openstack']['object-storage']['network']['container-bind-ip'] = '0.0.0.0'
default['openstack']['object-storage']['network']['container-bind-port'] = '6001'
# object servers
default['swift']['network']['object-bind-ip'] = '0.0.0.0'
default['swift']['network']['object-bind-port'] = '6000'
default['swift']['network']['object-cidr'] = '10.0.0.0/24'
default['openstack']['object-storage']['network']['object-bind-ip'] = '0.0.0.0'
default['openstack']['object-storage']['network']['object-bind-port'] = '6000'
default['openstack']['object-storage']['network']['object-cidr'] = '10.0.0.0/24'
#------------------
# sysctl
@@ -149,10 +149,11 @@ default['sysctl']['params']['net']['ipv4']['tcp_syncookies'] = 0
# Each predicate is evaluated in turn, and a false from the predicate
# will result in the disk not being considered as a candidate for
# formatting.
default['swift']['disk_test_filter'] = ['candidate =~ /(sd|hd|xvd|vd)(?!a$)[a-z]+/',
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
default['openstack']['object-storage']['disk_test_filter'] = [
'candidate =~ /(sd|hd|xvd|vd)(?!a$)[a-z]+/',
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
#-------------------
# template overrides
@@ -161,70 +162,70 @@ default['swift']['disk_test_filter'] = ['candidate =~ /(sd|hd|xvd|vd)(?!a$)[a-z]
# proxy-server
# enable or disable formpost
default['swift']['formpost']['enabled'] = false
default['openstack']['object-storage']['formpost']['enabled'] = false
# enable or disable tempurl
default['swift']['tempurl']['enabled'] = false
default['openstack']['object-storage']['tempurl']['enabled'] = false
# The headers to remove from incoming requests. Simply a whitespace delimited
# list of header names and names can optionally end with '*' to indicate a
# prefix match. incoming_allow_headers is a list of exceptions to these
# removals.
default['swift']['tempurl']['incoming_remove_headers'] = 'x-timestamp'
default['openstack']['object-storage']['tempurl']['incoming_remove_headers'] = 'x-timestamp'
# The headers allowed as exceptions to incoming_remove_headers. Simply a
# whitespace delimited list of header names and names can optionally end with
# '*' to indicate a prefix match.
default['swift']['tempurl']['incoming_allow_headers'] = ''
default['openstack']['object-storage']['tempurl']['incoming_allow_headers'] = ''
# The headers to remove from outgoing responses. Simply a whitespace delimited
# list of header names and names can optionally end with '*' to indicate a
# prefix match. outgoing_allow_headers is a list of exceptions to these
# removals.
default['swift']['tempurl']['outgoing_remove_headers'] = 'x-object-meta-*'
default['openstack']['object-storage']['tempurl']['outgoing_remove_headers'] = 'x-object-meta-*'
# The headers allowed as exceptions to outgoing_remove_headers. Simply a
# whitespace delimited list of header names and names can optionally end with
# '*' to indicate a prefix match.
default['swift']['tempurl']['outgoing_allow_headers'] = 'x-object-meta-public-*'
default['openstack']['object-storage']['tempurl']['outgoing_allow_headers'] = 'x-object-meta-public-*'
# enable or disable domain_remap
default['swift']['domain_remap']['enabled'] = false
default['openstack']['object-storage']['domain_remap']['enabled'] = false
# enable domain log name
default['swift']['domain_remap']['log_name'] = 'domain_remap'
default['openstack']['object-storage']['domain_remap']['log_name'] = 'domain_remap'
# domain remap log facilty
default['swift']['domain_remap']['log_facility'] = 'LOG_LOCAL0'
default['openstack']['object-storage']['domain_remap']['log_facility'] = 'LOG_LOCAL0'
# domain remap log level
default['swift']['domain_remap']['log_level'] = 'INFO'
default['openstack']['object-storage']['domain_remap']['log_level'] = 'INFO'
# domain remap log headers
default['swift']['domain_remap']['log_headers'] = 'False'
default['openstack']['object-storage']['domain_remap']['log_headers'] = 'False'
# domain remap reseller domain
default['swift']['domain_remap']['storage_domain'] = 'example.com'
default['openstack']['object-storage']['domain_remap']['storage_domain'] = 'example.com'
# domain remap root path
default['swift']['domain_remap']['path_root'] = 'v1'
default['openstack']['object-storage']['domain_remap']['path_root'] = 'v1'
# domain remap reseller prefixes
default['swift']['domain_remap']['reseller_prefixes'] = 'AUTH'
default['openstack']['object-storage']['domain_remap']['reseller_prefixes'] = 'AUTH'
# whether or not to enable staticweb in the swift proxy
default['swift']['staticweb']['enabled'] = false
default['openstack']['object-storage']['staticweb']['enabled'] = false
# Seconds to cache container x-container-meta-web-* header values.
default['swift']['staticweb']['cache_timeout'] = 300
default['openstack']['object-storage']['staticweb']['cache_timeout'] = 300
# staticweb logging options
default['swift']['staticweb']['log_facility'] = 'LOG_LOCAL0'
default['swift']['staticweb']['log_level'] = 'INFO'
default['swift']['staticweb']['access_log_name'] = 'staticweb'
default['swift']['staticweb']['access_log_facility'] = 'LOG_LOCAL0'
default['swift']['staticweb']['access_log_level'] = 'INFO'
default['swift']['staticweb']['log_headers'] = 'False'
default['openstack']['object-storage']['staticweb']['log_facility'] = 'LOG_LOCAL0'
default['openstack']['object-storage']['staticweb']['log_level'] = 'INFO'
default['openstack']['object-storage']['staticweb']['access_log_name'] = 'staticweb'
default['openstack']['object-storage']['staticweb']['access_log_facility'] = 'LOG_LOCAL0'
default['openstack']['object-storage']['staticweb']['access_log_level'] = 'INFO'
default['openstack']['object-storage']['staticweb']['log_headers'] = 'False'
# container-server
@@ -232,21 +233,21 @@ default['swift']['staticweb']['log_headers'] = 'False'
# to enable container sync for your end-users between clusters. This should
# be an array of fqdn hostnames for the cluster end-points that your end-users
# would access in the format of ['host1', 'host2', 'host3']
default['swift']['container-server']['allowed_sync_hosts'] = []
default['openstack']['object-storage']['container-server']['allowed_sync_hosts'] = []
# container-sync logging settings
default['swift']['container-server']['container-sync']['log_name'] = 'container-sync'
default['swift']['container-server']['container-sync']['log_facility'] = 'LOG_LOCAL0'
default['swift']['container-server']['container-sync']['log_level'] = 'INFO'
default['openstack']['object-storage']['container-server']['container-sync']['log_name'] = 'container-sync'
default['openstack']['object-storage']['container-server']['container-sync']['log_facility'] = 'LOG_LOCAL0'
default['openstack']['object-storage']['container-server']['container-sync']['log_level'] = 'INFO'
# If you need to use an HTTP Proxy, set it here; defaults to no proxy.
default['swift']['container-server']['container-sync']['sync_proxy'] = nil
default['openstack']['object-storage']['container-server']['container-sync']['sync_proxy'] = nil
# Will sync, at most, each container once per interval (in seconds)
default['swift']['container-server']['container-sync']['interval'] = 300
default['openstack']['object-storage']['container-server']['container-sync']['interval'] = 300
# Maximum amount of time to spend syncing each container per pass (in seconds)
default['swift']['container-server']['container-sync']['container_time'] = 60
default['openstack']['object-storage']['container-server']['container-sync']['container_time'] = 60
#------------------
# swauth source
@@ -255,9 +256,9 @@ default['swift']['container-server']['container-sync']['container_time'] = 60
# allows us to chose to install directly from a tagged branch of
# gholt's repository.
# values: package, git
default['swift']['swauth_source'] = 'package'
default['swift']['swauth_repository'] = 'https://github.com/gholt/swauth.git'
default['swift']['swauth_version'] = '1.0.8'
default['openstack']['object-storage']['swauth_source'] = 'package'
default['openstack']['object-storage']['swauth_repository'] = 'https://github.com/gholt/swauth.git'
default['openstack']['object-storage']['swauth_version'] = '1.0.8'
#------------------
# packages
@@ -266,7 +267,7 @@ default['swift']['swauth_version'] = '1.0.8'
# Leveling between distros
case platform
when 'redhat'
default['swift']['platform'] = {
default['openstack']['object-storage']['platform'] = {
'disk_format' => 'ext4',
'proxy_packages' => %w{openstack-swift-proxy sudo cronie python-memcached},
'object_packages' => ['openstack-swift-object', 'sudo', 'cronie'],
@@ -289,7 +290,7 @@ when 'redhat'
# python-iso8601 is a missing dependency for swift.
# https://bugzilla.redhat.com/show_bug.cgi?id=875948
when 'centos'
default['swift']['platform'] = {
default['openstack']['object-storage']['platform'] = {
'disk_format' => 'xfs',
'proxy_packages' => %w{openstack-swift-proxy sudo cronie python-iso8601 python-memcached},
'object_packages' => %w{openstack-swift-object sudo cronie python-iso8601},
@@ -309,7 +310,7 @@ when 'centos'
'swift_statsd_publish' => '/usr/bin/swift-statsd-publish.py'
}
when 'fedora'
default['swift']['platform'] = {
default['openstack']['object-storage']['platform'] = {
'disk_format' => 'xfs',
'proxy_packages' => ['openstack-swift-proxy', 'python-memcached'],
'object_packages' => ['openstack-swift-object'],
@@ -329,7 +330,7 @@ when 'fedora'
'swift_statsd_publish' => '/usr/bin/swift-statsd-publish.py'
}
when 'ubuntu'
default['swift']['platform'] = {
default['openstack']['object-storage']['platform'] = {
'disk_format' => 'xfs',
'proxy_packages' => ['swift-proxy', 'python-memcache'],
'object_packages' => ['swift-object'],

View File

@@ -155,7 +155,7 @@ action :ensure_exists do
if @new_resource.publish_attributes && dev_info != {}
dev_info.each do |k, v|
node.set['swift']['state']['devs'][k] = {
node.set['openstack']['object-storage']['state']['devs'][k] = {
device: v['device'],
size: v['size'],
uuid: v['uuid'],

View File

@@ -42,7 +42,7 @@ def generate_script
# Chef::Log.debug("#{ which.capitalize } Ring data: #{ring_data[:raw][which]}")
ring_data[:parsed][which] = parse_ring_output(ring_data[:raw][which])
node.set['swift']['state']['ring'][which] = ring_data[:parsed][which]
node.set['openstack']['object-storage']['state']['ring'][which] = ring_data[:parsed][which]
end
else
Chef::Log.info("#{which.capitalize} ring builder files do not exist!")
@@ -64,7 +64,7 @@ def generate_script
# figure out what's present in the cluster
disk_data[which] = {}
role = node['swift']["#{which}_server_chef_role"]
role = node['openstack']['object-storage']["#{which}_server_chef_role"]
disk_state, _, _ = Chef::Search::Query.new.search(:node, "chef_environment:#{node.chef_environment} AND roles:#{role}")
# for a running track of available disks
@@ -102,7 +102,7 @@ def generate_script
s = "#!/bin/bash\n\n# This script is automatically generated.\n"
s << "# Running it will likely blow up your system if you don't review it carefully.\n"
s << "# You have been warned.\n\n"
unless node['swift']['auto_rebuild_rings']
unless node['openstack']['object-storage']['auto_rebuild_rings']
s << "if [ \"$1\" != \"--force\" ]; then\n"
s << " echo \"Auto rebuild rings is disabled, so you must use --force to generate rings\"\n"
s << " exit 0\n"
@@ -175,8 +175,8 @@ def generate_script
end
# we'll only rebalance if we meet the minimums for new adds
if node['swift'].key?('wait_for')
if node['swift']['wait_for'] > new_servers.count
if node['openstack']['object-storage'].key?('wait_for')
if node['openstack']['object-storage']['wait_for'] > new_servers.count
Chef::Log.debug('New servers, but not enough to force a rebalance')
must_rebalance = false
end

View File

@@ -22,7 +22,7 @@ include_recipe 'openstack-object-storage::common'
include_recipe 'openstack-object-storage::storage-common'
include_recipe 'openstack-object-storage::disks'
platform_options = node['swift']['platform']
platform_options = node['openstack']['object-storage']['platform']
platform_options['account_packages'].each.each do |pkg|
package pkg do
@@ -86,8 +86,8 @@ template '/etc/swift/account-server.conf' do
group 'swift'
mode '0600'
variables(
'bind_ip' => node['swift']['network']['account-bind-ip'],
'bind_port' => node['swift']['network']['account-bind-port']
'bind_ip' => node['openstack']['object-storage']['network']['account-bind-ip'],
'bind_port' => node['openstack']['object-storage']['network']['account-bind-port']
)
notifies :restart, 'service[swift-account]', :immediately

View File

@@ -18,7 +18,7 @@
# limitations under the License.
#
platform_options = node['swift']['platform']
platform_options = node['openstack']['object-storage']['platform']
platform_options['swift_client_packages'].each do |pkg|
package pkg do
options platform_options['package_overrides']

View File

@@ -29,7 +29,7 @@ include_recipe 'sysctl::default'
#-------------
# optionally statsd daemon for stats collection
if node['swift']['statistics']['enabled']
if node['openstack']['object-storage']['statistics']['enabled']
node.set['statsd']['relay_server'] = true
include_recipe 'statsd::server'
end
@@ -39,34 +39,34 @@ if Chef::Config[:solo] && !node['recipes'].include?('chef-solo-search')
Chef::Log.warn('This recipe uses search. Chef Solo does not support search.')
graphite_servers = []
else
graphite_servers = search(:node, "roles:#{node['swift']['statistics']['graphing_role']} AND chef_environment:#{node.chef_environment}")
graphite_servers = search(:node, "roles:#{node['openstack']['object-storage']['statistics']['graphing_role']} AND chef_environment:#{node.chef_environment}")
end
graphite_host = '127.0.0.1'
unless graphite_servers.empty?
graphite_host = graphite_servers[0]['network']["ipaddress_#{node['swift']['statistics']['graphing_interface']}"]
graphite_host = graphite_servers[0]['network']["ipaddress_#{node['openstack']['object-storage']['statistics']['graphing_interface']}"]
end
if node['swift']['statistics']['graphing_ip'].nil?
if node['openstack']['object-storage']['statistics']['graphing_ip'].nil?
node.set['statsd']['graphite_host'] = graphite_host
else
node.set['statsd']['graphite_host'] = node['swift']['statistics']['graphing_ip']
node.set['statsd']['graphite_host'] = node['openstack']['object-storage']['statistics']['graphing_ip']
end
#--------------
# swift common
#--------------
platform_options = node['swift']['platform']
platform_options = node['openstack']['object-storage']['platform']
# update repository if requested with the ubuntu cloud
case node['platform']
when 'ubuntu'
Chef::Log.info('Creating apt repository for http://ubuntu-cloud.archive.canonical.com/ubuntu')
Chef::Log.info("chefspec: #{node['lsb']['codename']}-updates/#{node['swift']['release']}")
Chef::Log.info("chefspec: #{node['lsb']['codename']}-updates/#{node['openstack']['object-storage']['release']}")
apt_repository 'ubuntu_cloud' do
uri 'http://ubuntu-cloud.archive.canonical.com/ubuntu'
distribution "#{node['lsb']['codename']}-updates/#{node['swift']['release']}"
distribution "#{node['lsb']['codename']}-updates/#{node['openstack']['object-storage']['release']}"
components ['main']
key '5EDB1B62EC4926EA'
action :add
@@ -88,10 +88,10 @@ directory '/etc/swift' do
end
# determine hash
if node['swift']['swift_secret_databag_name'].nil?
swifthash = node['swift']['swift_hash']
if node['openstack']['object-storage']['swift_secret_databag_name'].nil?
swifthash = node['openstack']['object-storage']['swift_hash']
else
swift_secrets = Chef::EncryptedDataBagItem.load 'secrets', node['swift']['swift_secret_databag_name']
swift_secrets = Chef::EncryptedDataBagItem.load 'secrets', node['openstack']['object-storage']['swift_secret_databag_name']
swifthash = swift_secrets['swift_hash']
end
@@ -117,7 +117,7 @@ end
# drop a ring puller script
# TODO: make this smarter
git_builder_ip = node['swift']['git_builder_ip']
git_builder_ip = node['openstack']['object-storage']['git_builder_ip']
template '/etc/swift/pull-rings.sh' do
source 'pull-rings.sh.erb'
owner 'swift'

View File

@@ -22,7 +22,7 @@ include_recipe 'openstack-object-storage::common'
include_recipe 'openstack-object-storage::storage-common'
include_recipe 'openstack-object-storage::disks'
platform_options = node['swift']['platform']
platform_options = node['openstack']['object-storage']['platform']
platform_options['container_packages'].each do |pkg|
package pkg do
@@ -86,8 +86,8 @@ template '/etc/swift/container-server.conf' do
group 'swift'
mode '0600'
variables(
'bind_ip' => node['swift']['network']['container-bind-ip'],
'bind_port' => node['swift']['network']['container-bind-port']
'bind_ip' => node['openstack']['object-storage']['network']['container-bind-ip'],
'bind_port' => node['openstack']['object-storage']['network']['container-bind-port']
)
notifies :restart, 'service[swift-container]', :immediately
@@ -114,7 +114,7 @@ if platform?('ubuntu')
end
service_name = platform_options['service_prefix'] + 'swift-container-sync' + platform_options['service_suffix']
unless node['swift']['container-server']['allowed_sync_hosts'] == []
unless node['openstack']['object-storage']['container-server']['allowed_sync_hosts'] == []
service 'swift-container-sync' do
service_name service_name
provider platform_options['service_provider']

View File

@@ -25,7 +25,7 @@ class Chef::Recipe # rubocop:disable Documentation
include DriveUtils
end
platform_options = node['swift']['platform']
platform_options = node['openstack']['object-storage']['platform']
package 'xfsprogs' do
action :install
@@ -38,8 +38,8 @@ end
end
end
disk_enum_expr = node['swift']['disk_enum_expr']
disk_test_filter = node['swift']['disk_test_filter']
disk_enum_expr = node['openstack']['object-storage']['disk_enum_expr']
disk_test_filter = node['openstack']['object-storage']['disk_test_filter']
disks = locate_disks(disk_enum_expr, disk_test_filter)
@@ -55,7 +55,7 @@ end
#
# additionally, there is an implicit assumption that bind ports
# for all object/container/account services are on the same net
disk_ip = locate_ip_in_cidr(node['swift']['network']['object-cidr'], node)
disk_ip = locate_ip_in_cidr(node['openstack']['object-storage']['network']['object-cidr'], node)
openstack_object_storage_mounts '/srv/node' do
action :ensure_exists

View File

@@ -24,10 +24,10 @@ include_recipe 'openstack-object-storage::common'
# with multiple repos!
include_recipe 'openstack-object-storage::ring-repo'
platform_options = node['swift']['platform']
platform_options = node['openstack']['object-storage']['platform']
if node['swift']['authmode'] == 'swauth'
case node['swift']['swauth_source']
if node['openstack']['object-storage']['authmode'] == 'swauth'
case node['openstack']['object-storage']['swauth_source']
when 'package'
platform_options['swauth_packages'].each do |pkg|
package pkg do
@@ -37,8 +37,8 @@ if node['swift']['authmode'] == 'swauth'
end
when 'git'
git "#{Chef::Config[:file_cache_path]}/swauth" do
repository node['swift']['swauth_repository']
revision node['swift']['swauth_version']
repository node['openstack']['object-storage']['swauth_repository']
revision node['openstack']['object-storage']['swauth_version']
action :sync
end
@@ -55,16 +55,16 @@ if node['swift']['authmode'] == 'swauth'
end
# determine where to find dispersion login information
if node['swift']['swift_secret_databag_name'].nil?
auth_user = node['swift']['dispersion']['auth_user']
auth_key = node['swift']['dispersion']['auth_key']
if node['openstack']['object-storage']['swift_secret_databag_name'].nil?
auth_user = node['openstack']['object-storage']['dispersion']['auth_user']
auth_key = node['openstack']['object-storage']['dispersion']['auth_key']
else
swift_secrets = Chef::EncryptedDataBagItem.load 'secrets', node['swift']['swift_secret_databag_name']
swift_secrets = Chef::EncryptedDataBagItem.load 'secrets', node['openstack']['object-storage']['swift_secret_databag_name']
auth_user = swift_secrets['dispersion_auth_user']
auth_key = swift_secrets['dispersion_auth_key']
end
if node['swift']['statistics']['enabled']
if node['openstack']['object-storage']['statistics']['enabled']
template platform_options['swift_statsd_publish'] do
source 'swift-statsd-publish.py.erb'
owner 'root'
@@ -73,7 +73,7 @@ if node['swift']['statistics']['enabled']
end
cron 'cron_swift_statsd_publish' do
command "#{platform_options['swift_statsd_publish']} > /dev/null 2>&1"
minute "*/#{node["swift"]["statistics"]["report_frequency"]}"
minute "*/#{node['openstack']['object-storage']['statistics']['report_frequency']}"
end
end
@@ -83,7 +83,7 @@ template '/etc/swift/dispersion.conf' do
group 'swift'
mode '0600'
variables(
'auth_url' => node['swift']['auth_url'],
'auth_url' => node['openstack']['object-storage']['auth_url'],
'auth_user' => auth_user,
'auth_key' => auth_key
)

View File

@@ -22,7 +22,7 @@ include_recipe 'openstack-object-storage::common'
include_recipe 'openstack-object-storage::storage-common'
include_recipe 'openstack-object-storage::disks'
platform_options = node['swift']['platform']
platform_options = node['openstack']['object-storage']['platform']
platform_options['object_packages'].each do |pkg|
package pkg do
@@ -89,8 +89,8 @@ template '/etc/swift/object-server.conf' do
group 'swift'
mode '0600'
variables(
'bind_ip' => node['swift']['network']['object-bind-ip'],
'bind_port' => node['swift']['network']['object-bind-port']
'bind_ip' => node['openstack']['object-storage']['network']['object-bind-ip'],
'bind_port' => node['openstack']['object-storage']['network']['object-bind-port']
)
notifies :restart, 'service[swift-object]', :immediately

View File

@@ -27,19 +27,19 @@ end
if node.run_list.expand(node.chef_environment).recipes.include?('openstack-object-storage::setup')
Chef::Log.info('I ran the openstack-object-storage::setup so I will use my own swift passwords')
else
setup_role = node['swift']['setup_chef_role']
setup_role = node['openstack']['object-storage']['setup_chef_role']
setup = search(:node, "chef_environment:#{node.chef_environment} AND roles:#{setup_role}")
if setup.length == 0
Chef::Application.fatal! 'You must have run the openstack-object-storage::setup recipe (on this or another node) before running the swift::proxy recipe on this node'
elsif setup.length == 1
Chef::Log.info "Found openstack-object-storage::setup node: #{setup[0].name}"
node.set['swift']['service_pass'] = setup[0]['swift']['service_pass']
node.set['openstack']['object-storage']['service_pass'] = setup[0]['swift']['service_pass']
elsif setup.length > 1
Chef::Application.fatal! 'You have multiple nodes in your environment that have run swift-setup, and that is not allowed'
end
end
platform_options = node['swift']['platform']
platform_options = node['openstack']['object-storage']['platform']
# install platform-specific packages
platform_options['proxy_packages'].each do |pkg|
@@ -49,8 +49,8 @@ platform_options['proxy_packages'].each do |pkg|
end
end
if node['swift']['authmode'] == 'swauth'
case node['swift']['swauth_source']
if node['openstack']['object-storage']['authmode'] == 'swauth'
case node['openstack']['object-storage']['swauth_source']
when 'package'
platform_options['swauth_packages'].each do |pkg|
package pkg do
@@ -60,8 +60,8 @@ if node['swift']['authmode'] == 'swauth'
end
when 'git'
git "#{Chef::Config[:file_cache_path]}/swauth" do
repository node['swift']['swauth_repository']
revision node['swift']['swauth_version']
repository node['openstack']['object-storage']['swauth_repository']
revision node['openstack']['object-storage']['swauth_version']
action :sync
end
@@ -79,12 +79,12 @@ end
package 'python-swift-informant' do
action :install
only_if { node['swift']['use_informant'] }
only_if { node['openstack']['object-storage']['use_informant'] }
end
package 'python-keystone' do
action :install
only_if { node['swift']['authmode'] == 'keystone' }
only_if { node['openstack']['object-storage']['authmode'] == 'keystone' }
end
directory '/var/cache/swift' do
@@ -109,10 +109,10 @@ if Chef::Config[:solo]
memcache_servers = ['127.0.0.1:11211']
else
memcache_servers = []
proxy_role = node['swift']['proxy_server_chef_role']
proxy_role = node['openstack']['object-storage']['proxy_server_chef_role']
proxy_nodes = search(:node, "chef_environment:#{node.chef_environment} AND roles:#{proxy_role}")
proxy_nodes.each do |proxy|
proxy_ip = locate_ip_in_cidr(node['swift']['network']['proxy-cidr'], proxy)
proxy_ip = locate_ip_in_cidr(node['openstack']['object-storage']['network']['proxy-cidr'], proxy)
next unless proxy_ip # skip nil ips so we dont break the config
server_str = "#{proxy_ip}:11211"
memcache_servers << server_str unless memcache_servers.include?(server_str)
@@ -120,10 +120,10 @@ else
end
# determine authkey to use
if node['swift']['swift_secret_databag_name'].nil?
authkey = node['swift']['authkey']
if node['openstack']['object-storage']['swift_secret_databag_name'].nil?
authkey = node['openstack']['object-storage']['authkey']
else
swift_secrets = Chef::EncryptedDataBagItem.load 'secrets', node['swift']['swift_secret_databag_name']
swift_secrets = Chef::EncryptedDataBagItem.load 'secrets', node['openstack']['object-storage']['swift_secret_databag_name']
authkey = swift_secrets['swift_authkey']
end
@@ -134,9 +134,9 @@ template '/etc/swift/proxy-server.conf' do
group 'swift'
mode '0600'
variables(
'authmode' => node['swift']['authmode'],
'bind_host' => node['swift']['network']['proxy-bind-ip'],
'bind_port' => node['swift']['network']['proxy-bind-port'],
'authmode' => node['openstack']['object-storage']['authmode'],
'bind_host' => node['openstack']['object-storage']['network']['proxy-bind-ip'],
'bind_port' => node['openstack']['object-storage']['network']['proxy-bind-port'],
'authkey' => authkey,
'memcache_servers' => memcache_servers
)

View File

@@ -22,8 +22,8 @@
# for purposes of ring synchronization
#
platform_options = node['swift']['platform']
ring_options = node['swift']['ring']
platform_options = node['openstack']['object-storage']['platform']
ring_options = node['openstack']['object-storage']['ring']
platform_options['git_packages'].each do |pkg|
package pkg do

View File

@@ -18,7 +18,7 @@
# limitations under the License.
#
platform_options = node['swift']['platform']
platform_options = node['openstack']['object-storage']['platform']
platform_options['rsync_packages'].each do |pkg|
package pkg do

View File

@@ -23,18 +23,18 @@ include_recipe 'openstack-object-storage::common'
if Chef::Config[:solo]
Chef::Application.fatal! 'This recipe uses search. Chef Solo does not support search.'
else
setup_role = node['swift']['setup_chef_role']
setup_role = node['openstack']['object-storage']['setup_chef_role']
setup_role_count = search(:node, "chef_environment:#{node.chef_environment} AND roles:#{setup_role}").length
if setup_role_count > 1
Chef::Application.fatal! 'You can only have one node with the swift-setup role'
end
end
unless node['swift']['service_pass']
unless node['openstack']['object-storage']['service_pass']
Chef::Log.info('Running swift setup - setting swift passwords')
end
platform_options = node['swift']['platform']
platform_options = node['openstack']['object-storage']['platform']
# install platform-specific packages
platform_options['proxy_packages'].each do |pkg|
@@ -44,8 +44,8 @@ platform_options['proxy_packages'].each do |pkg|
end
end
if node['swift']['authmode'] == 'swauth'
case node['swift']['swauth_source']
if node['openstack']['object-storage']['authmode'] == 'swauth'
case node['openstack']['object-storage']['swauth_source']
when 'package'
platform_options['swauth_packages'].each do |pkg|
package pkg do
@@ -55,8 +55,8 @@ if node['swift']['authmode'] == 'swauth'
end
when 'git'
git "#{Chef::Config[:file_cache_path]}/swauth" do
repository node['swift']['swauth_repository']
revision node['swift']['swauth_version']
repository node['openstack']['object-storage']['swauth_repository']
revision node['openstack']['object-storage']['swauth_version']
action :sync
end
@@ -74,10 +74,10 @@ end
package 'python-swift-informant' do
action :upgrade
only_if { node['swift']['use_informant'] }
only_if { node['openstack']['object-storage']['use_informant'] }
end
package 'python-keystone' do
action :upgrade
only_if { node['swift']['authmode'] == 'keystone' }
only_if { node['openstack']['object-storage']['authmode'] == 'keystone' }
end

View File

@@ -28,7 +28,7 @@ template '/etc/swift/drive-audit.conf' do
end
cron 'drive-audit' do
hour node['swift']['audit_hour']
hour node['openstack']['object-storage']['audit_hour']
minute '10'
command 'swift-drive-audit /etc/swift/drive-audit.conf'
end

View File

@@ -14,14 +14,15 @@ describe 'openstack-object-storage::account-server' do
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
@node = @chef_run.node
@node.set['lsb']['code'] = 'precise'
@node.set['swift']['authmode'] = 'swauth'
@node.set['swift']['network']['account-bind-ip'] = '10.0.0.1'
@node.set['swift']['network']['account-bind-port'] = '8080'
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
@node.set['swift']['disk_test_filter'] = ['candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
@node.set['openstack']['object-storage']['authmode'] = 'swauth'
@node.set['openstack']['object-storage']['network']['account-bind-ip'] = '10.0.0.1'
@node.set['openstack']['object-storage']['network']['account-bind-port'] = '8080'
@node.set['openstack']['object-storage']['disk_enum_expr'] = "[{ 'sda' => {}}]"
@node.set['openstack']['object-storage']['disk_test_filter'] = [
'candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
# mock out an interface on the storage node
@node.set['network'] = MOCK_NODE_NETWORK_DATA['network']

View File

@@ -15,9 +15,9 @@ describe 'openstack-object-storage::common' do
@node = @chef_run.node
@node.set['platform_family'] = 'debian'
@node.set['lsb']['codename'] = 'precise'
@node.set['swift']['release'] = 'havana'
@node.set['swift']['authmode'] = 'swauth'
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
@node.set['openstack']['object-storage']['release'] = 'havana'
@node.set['openstack']['object-storage']['authmode'] = 'swauth'
@node.set['openstack']['object-storage']['git_builder_ip'] = '10.0.0.10'
# TODO: this does not work
# ::Chef::Log.should_receive(:info).with('chefspec: precise-updates/havana')

View File

@@ -14,16 +14,17 @@ describe 'openstack-object-storage::container-server' do
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
@node = @chef_run.node
@node.set['lsb']['code'] = 'precise'
@node.set['swift']['authmode'] = 'swauth'
@node.set['swift']['network']['container-bind-ip'] = '10.0.0.1'
@node.set['swift']['network']['container-bind-port'] = '8080'
@node.set['swift']['container-server']['allowed_sync_hosts'] = ['host1', 'host2', 'host3']
@node.set['swift']['container-bind-port'] = '8080'
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
@node.set['swift']['disk_test_filter'] = ['candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
@node.set['openstack']['object-storage']['authmode'] = 'swauth'
@node.set['openstack']['object-storage']['network']['container-bind-ip'] = '10.0.0.1'
@node.set['openstack']['object-storage']['network']['container-bind-port'] = '8080'
@node.set['openstack']['object-storage']['container-server']['allowed_sync_hosts'] = ['host1', 'host2', 'host3']
@node.set['openstack']['object-storage']['container-bind-port'] = '8080'
@node.set['openstack']['object-storage']['disk_enum_expr'] = "[{ 'sda' => {}}]"
@node.set['openstack']['object-storage']['disk_test_filter'] = [
'candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
# mock out an interface on the storage node
@node.set['network'] = MOCK_NODE_NETWORK_DATA['network']
@@ -74,7 +75,7 @@ describe 'openstack-object-storage::container-server' do
before do
@node = @chef_run.node
@node.set['swift']['container-server']['allowed_sync_hosts'] = []
@node.set['openstack']['object-storage']['container-server']['allowed_sync_hosts'] = []
@chef_run.converge 'openstack-object-storage::container-server'
@file = @chef_run.template '/etc/swift/container-server.conf'
end

View File

@@ -15,14 +15,15 @@ describe 'openstack-object-storage::disks' do
@node = @chef_run.node
@node.set['platform_family'] = 'debian'
@node.set['lsb']['codename'] = 'precise'
@node.set['swift']['release'] = 'havana'
@node.set['swift']['authmode'] = 'swauth'
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
@node.set['swift']['disk_test_filter'] = ['candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
@node.set['openstack']['object-storage']['release'] = 'havana'
@node.set['openstack']['object-storage']['authmode'] = 'swauth'
@node.set['openstack']['object-storage']['git_builder_ip'] = '10.0.0.10'
@node.set['openstack']['object-storage']['disk_enum_expr'] = "[{ 'sda' => {}}]"
@node.set['openstack']['object-storage']['disk_test_filter'] = [
'candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
# mock out an interface on the storage node
@node.set['network'] = MOCK_NODE_NETWORK_DATA['network']

View File

@@ -14,10 +14,10 @@ describe 'openstack-object-storage::management-server' do
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
@node = @chef_run.node
@node.set['lsb']['code'] = 'precise'
@node.set['swift']['authmode'] = 'swauth'
@node.set['swift']['statistics']['enabled'] = true
@node.set['swift']['swauth_source'] = 'package'
@node.set['swift']['platform']['swauth_packages'] = ['swauth']
@node.set['openstack']['object-storage']['authmode'] = 'swauth'
@node.set['openstack']['object-storage']['statistics']['enabled'] = true
@node.set['openstack']['object-storage']['swauth_source'] = 'package'
@node.set['openstack']['object-storage']['platform']['swauth_packages'] = ['swauth']
@chef_run.converge 'openstack-object-storage::management-server'
end

View File

@@ -14,14 +14,15 @@ describe 'openstack-object-storage::object-server' do
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
@node = @chef_run.node
@node.set['lsb']['code'] = 'precise'
@node.set['swift']['authmode'] = 'swauth'
@node.set['swift']['network']['object-bind-ip'] = '10.0.0.1'
@node.set['swift']['network']['object-bind-port'] = '8080'
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
@node.set['swift']['disk_test_filter'] = ['candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
@node.set['openstack']['object-storage']['authmode'] = 'swauth'
@node.set['openstack']['object-storage']['network']['object-bind-ip'] = '10.0.0.1'
@node.set['openstack']['object-storage']['network']['object-bind-port'] = '8080'
@node.set['openstack']['object-storage']['disk_enum_expr'] = "[{ 'sda' => {}}]"
@node.set['openstack']['object-storage']['disk_test_filter'] = [
'candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
# mock out an interface on the storage node
@node.set['network'] = MOCK_NODE_NETWORK_DATA['network']

View File

@@ -15,11 +15,11 @@ describe 'openstack-object-storage::proxy-server' do
@node = @chef_run.node
@node.set['cpu']['total'] = 6
@node.set['lsb']['code'] = 'precise'
@node.set['swift']['authmode'] = 'swauth'
@node.set['swift']['platform']['swauth_packages'] = ['swauth']
@node.set['swift']['swauth_source'] = 'package'
@node.set['swift']['network']['proxy-bind-ip'] = '10.0.0.1'
@node.set['swift']['network']['proxy-bind-port'] = '8080'
@node.set['openstack']['object-storage']['authmode'] = 'swauth'
@node.set['openstack']['object-storage']['platform']['swauth_packages'] = ['swauth']
@node.set['openstack']['object-storage']['swauth_source'] = 'package'
@node.set['openstack']['object-storage']['network']['proxy-bind-ip'] = '10.0.0.1'
@node.set['openstack']['object-storage']['network']['proxy-bind-port'] = '8080'
@chef_run.converge 'openstack-object-storage::proxy-server'
end
@@ -69,7 +69,7 @@ describe 'openstack-object-storage::proxy-server' do
before do
@node = @chef_run.node
@node.set['swift']['domain_remap']['enabled'] = true
@node.set['openstack']['object-storage']['domain_remap']['enabled'] = true
@chef_run.converge 'openstack-object-storage::proxy-server'
@file = @chef_run.template '/etc/swift/proxy-server.conf'
end
@@ -91,7 +91,7 @@ describe 'openstack-object-storage::proxy-server' do
before do
@node = @chef_run.node
@node.set['swift']['formpost']['enabled'] = true
@node.set['openstack']['object-storage']['formpost']['enabled'] = true
@chef_run.converge 'openstack-object-storage::proxy-server'
@file = @chef_run.template '/etc/swift/proxy-server.conf'
end
@@ -110,7 +110,7 @@ describe 'openstack-object-storage::proxy-server' do
before do
@node = @chef_run.node
@node.set['swift']['staticweb']['enabled'] = true
@node.set['openstack']['object-storage']['staticweb']['enabled'] = true
@chef_run.converge 'openstack-object-storage::proxy-server'
@file = @chef_run.template '/etc/swift/proxy-server.conf'
end
@@ -130,7 +130,7 @@ describe 'openstack-object-storage::proxy-server' do
before do
@node = @chef_run.node
@node.set['swift']['tempurl']['enabled'] = true
@node.set['openstack']['object-storage']['tempurl']['enabled'] = true
@chef_run.converge 'openstack-object-storage::proxy-server'
@file = @chef_run.template '/etc/swift/proxy-server.conf'
end

View File

@@ -15,9 +15,9 @@ describe 'openstack-object-storage::ring-repo' do
@node = @chef_run.node
@node.set['platform_family'] = 'debian'
@node.set['lsb']['codename'] = 'precise'
@node.set['swift']['release'] = 'havana'
@node.set['swift']['authmode'] = 'swauth'
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
@node.set['openstack']['object-storage']['release'] = 'havana'
@node.set['openstack']['object-storage']['authmode'] = 'swauth'
@node.set['openstack']['object-storage']['git_builder_ip'] = '10.0.0.10'
@chef_run.converge 'openstack-object-storage::ring-repo'
end

View File

@@ -15,9 +15,9 @@ describe 'openstack-object-storage::rsync' do
@node = @chef_run.node
@node.set['platform_family'] = 'debian'
@node.set['lsb']['codename'] = 'precise'
@node.set['swift']['release'] = 'havana'
@node.set['swift']['authmode'] = 'swauth'
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
@node.set['openstack']['object-storage']['release'] = 'havana'
@node.set['openstack']['object-storage']['authmode'] = 'swauth'
@node.set['openstack']['object-storage']['git_builder_ip'] = '10.0.0.10'
@chef_run.converge 'openstack-object-storage::rsync'
end

View File

@@ -14,7 +14,7 @@ describe 'openstack-object-storage::storage-common' do
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
@node = @chef_run.node
@node.set['lsb']['code'] = 'precise'
@node.set['swift']['authmode'] = 'swauth'
@node.set['openstack']['object-storage']['authmode'] = 'swauth'
@chef_run.converge 'openstack-object-storage::storage-common'
end

View File

@@ -18,15 +18,15 @@
bind_ip = <%= @bind_ip %>
bind_port = <%= @bind_port %>
workers = 10
<% if node["swift"]["enable_statistics"] -%>
<% if node['openstack']['object-storage']["enable_statistics"] -%>
log_statsd_host = localhost
log_statsd_port = 8125
log_statsd_default_sample_rate = 1
log_statsd_metric_prefix = openstack.swift.<%= node["hostname"] %>
<% end -%>
<% if node["swift"]["container-server"]["allowed_sync_hosts"] -%>
allowed_sync_hosts = <%= node["swift"]["container-server"]["allowed_sync_hosts"].join(",") %>
<% if node['openstack']['object-storage']["container-server"]["allowed_sync_hosts"] -%>
allowed_sync_hosts = <%= node['openstack']['object-storage']["container-server"]["allowed_sync_hosts"].join(",") %>
<% end -%>
[pipeline:main]
@@ -81,14 +81,14 @@ use = egg:swift#container
[container-sync]
# You can override the default log routing for this app here (don't use set!):
log_name = <%= node["swift"]["container-server"]["container-sync"]["log_name"] %>
log_facility = <%= node["swift"]["container-server"]["container-sync"]["log_facility"] %>
log_level = <%= node["swift"]["container-server"]["container-sync"]["log_level"] %>
log_name = <%= node['openstack']['object-storage']["container-server"]["container-sync"]["log_name"] %>
log_facility = <%= node['openstack']['object-storage']["container-server"]["container-sync"]["log_facility"] %>
log_level = <%= node['openstack']['object-storage']["container-server"]["container-sync"]["log_level"] %>
# If you need to use an HTTP Proxy, set it here; defaults to no proxy.
<% if node["swift"]["container-server"]["container-sync"]["sync_proxy"] -%>
sync_proxy = <%= node["swift"]["container-server"]["container-sync"]["sync_proxy"] %>
<% if node['openstack']['object-storage']["container-server"]["container-sync"]["sync_proxy"] -%>
sync_proxy = <%= node['openstack']['object-storage']["container-server"]["container-sync"]["sync_proxy"] %>
<% end -%>
# Will sync, at most, each container once per interval
interval = <%= node["swift"]["container-server"]["container-sync"]["interval"] %>
interval = <%= node['openstack']['object-storage']["container-server"]["container-sync"]["interval"] %>
# Maximum amount of time to spend syncing each container per pass
container_time = <%= node["swift"]["container-server"]["container-sync"]["container_time"] %>
container_time = <%= node['openstack']['object-storage']["container-server"]["container-sync"]["container_time"] %>

View File

@@ -5,15 +5,15 @@ pipeline = []
# the pipeline ordering is important and certain inclusions
# must either preceed or follow the selected auth module
if (node['swift']['authmode'] == "swauth" and node['swift']['tempurl']['enabled'] == true)
if (node['openstack']['object-storage']['authmode'] == "swauth" and node['openstack']['object-storage']['tempurl']['enabled'] == true)
pipeline << "tempurl"
end
if node['swift']['domain_remap']['enabled']
if node['openstack']['object-storage']['domain_remap']['enabled']
pipeline << "domain_remap"
end
if node['swift']['formpost']['enabled']
if node['openstack']['object-storage']['formpost']['enabled']
pipeline << "formpost"
end
@@ -25,7 +25,7 @@ when "swauth"
pipeline << "swauth"
end
if node['swift']['staticweb']['enabled']
if node['openstack']['object-storage']['staticweb']['enabled']
pipeline << "staticweb"
end
@@ -39,8 +39,8 @@ end
# This file is managed by chef. Do not edit it.
#
# Cluster info:
# Auth mode: <%= node['swift']['authmode'] %>
# Management server: <%= node[:roles].include?(node['swift']['management_server_chef_role']) %>
# Auth mode: <%= node['openstack']['object-storage']['authmode'] %>
# Management server: <%= node[:roles].include?(node['openstack']['object-storage']['management_server_chef_role']) %>
# Account management enabled: <%= account_management %>
# Auth pipeline: <%= pipeline %>
@@ -62,11 +62,11 @@ end
workers = <%= [ node['cpu']['total'] - 1, 1 ].max %>
bind_ip = <%= @bind_host %>
bind_port = <%= @bind_port %>
<% if node['swift']['statistics']['enabled'] -%>
<% if node['openstack']['object-storage']['statistics']['enabled'] -%>
log_statsd_host = localhost
log_statsd_port = 8125
log_statsd_default_sample_rate = <%= node['swift']['statistics'][:sample_rate] %>
log_statsd_metric_prefix = <%= node['swift']['statistics']['statsd_prefix'] %>.<%= node['hostname'] %>
log_statsd_default_sample_rate = <%= node['openstack']['object-storage']['statistics'][:sample_rate] %>
log_statsd_metric_prefix = <%= node['openstack']['object-storage']['statistics']['statsd_prefix'] %>.<%= node['hostname'] %>
<% end %>
@@ -119,12 +119,12 @@ use = egg:swauth#swauth
# super_admin_key = <secret_key>
######
super_admin_key = <%= @authkey %>
default_swift_cluster = local#<%= node['swift']['swift_url'] %>#<%= node['swift']['swauth_url'] %>
default_swift_cluster = local#<%= node['openstack']['object-storage']['swift_url'] %>#<%= node['openstack']['object-storage']['swauth_url'] %>
<% if pipeline.include?("tempurl") -%>
allow_overrides = true
<% end %>
<% if node['swift']['container-server']['allowed_sync_hosts'] -%>
allowed_sync_hosts = <%= node['swift']['container-server']['allowed_sync_hosts'].join(",") %>
<% if node['openstack']['object-storage']['container-server']['allowed_sync_hosts'] -%>
allowed_sync_hosts = <%= node['openstack']['object-storage']['container-server']['allowed_sync_hosts'].join(",") %>
<% end %>
<% end %>
@@ -186,13 +186,13 @@ use = egg:swift#ratelimit
[filter:domain_remap]
use = egg:swift#domain_remap
# You can override the default log routing for this filter here:
set log_name = <%= node['swift']['domain_remap']['log_name'] %>
set log_facility = <%= node['swift']['domain_remap']['log_facility'] %>
set log_level = <%= node['swift']['domain_remap']['log_level'] %>
set log_headers = <%= node['swift']['domain_remap']['log_headers'] %>
storage_domain = <%= node['swift']['domain_remap']['storage_domain'] %>
path_root = <%= node['swift']['domain_remap']['path_root'] %>
reseller_prefixes = <%= node['swift']['domain_remap']['reseller_prefixes'] %>
set log_name = <%= node['openstack']['object-storage']['domain_remap']['log_name'] %>
set log_facility = <%= node['openstack']['object-storage']['domain_remap']['log_facility'] %>
set log_level = <%= node['openstack']['object-storage']['domain_remap']['log_level'] %>
set log_headers = <%= node['openstack']['object-storage']['domain_remap']['log_headers'] %>
storage_domain = <%= node['openstack']['object-storage']['domain_remap']['storage_domain'] %>
path_root = <%= node['openstack']['object-storage']['domain_remap']['path_root'] %>
reseller_prefixes = <%= node['openstack']['object-storage']['domain_remap']['reseller_prefixes'] %>
[filter:catch_errors]
use = egg:swift#catch_errors
@@ -217,15 +217,15 @@ use = egg:swift#cname_lookup
[filter:staticweb]
use = egg:swift#staticweb
# Seconds to cache container x-container-meta-web-* header values.
cache_timeout = <%= node['swift']['staticweb']['cache_timeout'] %>
cache_timeout = <%= node['openstack']['object-storage']['staticweb']['cache_timeout'] %>
# You can override the default log routing for this filter here:
set log_name = <%= node['swift']['staticweb']['log_name'] %>
set log_facility = <%= node['swift']['staticweb']['log_facility'] %>
set log_level = <%= node['swift']['staticweb']['log_level'] %>
set access_log_name = <%= node['swift']['staticweb']['access_log_name'] %>
set access_log_facility = <%= node['swift']['staticweb']['access_log_facility'] %>
set access_log_level = <%= node['swift']['staticweb']['access_log_level'] %>
set log_headers = <%= node['swift']['staticweb']['log_headers'] %>
set log_name = <%= node['openstack']['object-storage']['staticweb']['log_name'] %>
set log_facility = <%= node['openstack']['object-storage']['staticweb']['log_facility'] %>
set log_level = <%= node['openstack']['object-storage']['staticweb']['log_level'] %>
set access_log_name = <%= node['openstack']['object-storage']['staticweb']['access_log_name'] %>
set access_log_facility = <%= node['openstack']['object-storage']['staticweb']['access_log_facility'] %>
set access_log_level = <%= node['openstack']['object-storage']['staticweb']['access_log_level'] %>
set log_headers = <%= node['openstack']['object-storage']['staticweb']['log_headers'] %>
# Note: Put tempurl just before your auth filter(s) in the pipeline
[filter:tempurl]
@@ -235,23 +235,23 @@ use = egg:swift#tempurl
# list of header names and names can optionally end with '*' to indicate a
# prefix match. incoming_allow_headers is a list of exceptions to these
# removals.
incoming_remove_headers = <%= node['swift']['tempurl']['incoming_remove_headers'] %>
incoming_remove_headers = <%= node['openstack']['object-storage']['tempurl']['incoming_remove_headers'] %>
#
# The headers allowed as exceptions to incoming_remove_headers. Simply a
# whitespace delimited list of header names and names can optionally end with
# '*' to indicate a prefix match.
incoming_allow_headers = <%= node['swift']['tempurl']['incoming_allow_headers'] %>
incoming_allow_headers = <%= node['openstack']['object-storage']['tempurl']['incoming_allow_headers'] %>
#
# The headers to remove from outgoing responses. Simply a whitespace delimited
# list of header names and names can optionally end with '*' to indicate a
# prefix match. outgoing_allow_headers is a list of exceptions to these
# removals.
outgoing_remove_headers = <%= node['swift']['tempurl']['outgoing_remove_headers'] %>
outgoing_remove_headers = <%= node['openstack']['object-storage']['tempurl']['outgoing_remove_headers'] %>
#
# The headers allowed as exceptions to outgoing_remove_headers. Simply a
# whitespace delimited list of header names and names can optionally end with
# '*' to indicate a prefix match.
outgoing_allow_headers = <%= node['swift']['tempurl']['outgoing_allow_headers'] %>
outgoing_allow_headers = <%= node['openstack']['object-storage']['tempurl']['outgoing_allow_headers'] %>
# Note: Put formpost just before your auth filter(s) in the pipeline
[filter:formpost]
@@ -273,7 +273,7 @@ use = egg:swift#proxy_logging
# You can use log_statsd_* from [DEFAULT] or override them here:
# access_log_statsd_host = localhost
# access_log_statsd_port = 8125
# access_log_statsd_default_sample_rate = <%= node['swift']['statistics']['sample_rate'] %>
# access_log_statsd_default_sample_rate = <%= node['openstack']['object-storage']['statistics']['sample_rate'] %>
# access_log_statsd_metric_prefix =
# access_log_headers = False
# What HTTP methods are allowed for StatsD logging (comma-sep); request methods

View File

@@ -41,27 +41,27 @@ class OpenStackSwiftStatisticsCollector(object):
def __init__(self):
'''Setup some initial values defined by chef'''
self.statsd_host = '<%= node[:swift][:statistics][:statsd_host] %>'
self.statsd_port = <%= node[:swift][:statistics][:statsd_port] %>
self.statsd_prefix = '<%= node[:swift][:statistics][:statsd_prefix] %>'
<% if node[:swift][:statistics][:enable_dispersion_report] -%>
self.statsd_host = '<%= node['openstack']['object-storage']['statistics']['statsd_host'] %>'
self.statsd_port = <%= node['openstack']['object-storage']['statistics']['statsd_port'] %>
self.statsd_prefix = '<%= node['openstack']['object-storage']['statistics']['statsd_prefix'] %>'
<% if node['openstack']['object-storage']['statistics']['enable_dispersion_report'] -%>
self.enable_dispersion_report = True
<% else %>
self.enable_dispersion_report = False
<% end %>
<% if node[:swift][:statistics][:enable_recon_report] -%>
<% if node['openstack']['object-storage']['statistics']['enable_recon_report'] -%>
self.enable_recon_report = True
<% else %>
self.enable_recon_report = False
<% end %>
<% if node[:swift][:statistics][:enable_disk_report] -%>
<% if node['openstack']['object-storage']['statistics']['enable_disk_report'] -%>
self.enable_disk_report = True
<% else %>
self.enable_disk_report = False
<% end %>
self.recon_account_cache = '<%= node[:swift][:statistics][:recon_account_cache] %>'
self.recon_container_cache = '<%= node[:swift][:statistics][:recon_container_cache] %>'
self.recon_object_cache = '<%= node[:swift][:statistics][:recon_object_cache] %>'
self.recon_account_cache = '<%= node['openstack']['object-storage']['statistics']['recon_account_cache'] %>'
self.recon_container_cache = '<%= node['openstack']['object-storage']['statistics']['recon_container_cache'] %>'
self.recon_object_cache = '<%= node['openstack']['object-storage']['statistics']['recon_object_cache'] %>'
def _dispersion_report(self):
"""