Add ability to pull python-swauth from git repository
Distribution packaged versions of python-swauth can be very old. Installing python-swauth-1.0.8 from gholt's GitHub repository brings in the ability to set allow_overrides so that middleware such as TempURL and FormPost work well with swauth * Added attributes to allow toggling between distribution package / git * Added attributes to specify repository and tagged revision * Added conditional install based on above attributes * Bumped metadata and CHANGELOG Change-Id: I5eaafb8af9977939bbb7f5b68baf3c9cbac8be7c
This commit is contained in:
@@ -9,31 +9,31 @@
|
||||
"ref": "f759cd013c0a836f2acb219b3e006ff0a1308878"
|
||||
},
|
||||
"memcached": {
|
||||
"locked_version": "1.4.0"
|
||||
"locked_version": "1.6.2"
|
||||
},
|
||||
"runit": {
|
||||
"locked_version": "1.1.6"
|
||||
"locked_version": "1.3.0"
|
||||
},
|
||||
"build-essential": {
|
||||
"locked_version": "1.4.0"
|
||||
"locked_version": "1.4.2"
|
||||
},
|
||||
"yum": {
|
||||
"locked_version": "2.3.0"
|
||||
"locked_version": "2.4.0"
|
||||
},
|
||||
"sysctl": {
|
||||
"locked_version": "0.3.3"
|
||||
},
|
||||
"apt": {
|
||||
"locked_version": "2.1.0"
|
||||
"locked_version": "2.3.0"
|
||||
},
|
||||
"git": {
|
||||
"locked_version": "2.5.2"
|
||||
"locked_version": "2.7.0"
|
||||
},
|
||||
"dmg": {
|
||||
"locked_version": "1.1.0"
|
||||
"locked_version": "2.0.4"
|
||||
},
|
||||
"windows": {
|
||||
"locked_version": "1.10.0"
|
||||
"locked_version": "1.11.0"
|
||||
},
|
||||
"chef_handler": {
|
||||
"locked_version": "1.1.4"
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
This file is used to list changes made in each version of cookbook-openstack-object-storage.
|
||||
|
||||
## 7.0.6:
|
||||
* Add choice of install python-swauth from git or package
|
||||
|
||||
## 7.0.5:
|
||||
* Add support for container-sync
|
||||
|
||||
|
||||
@@ -179,11 +179,21 @@ default["swift"]["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
|
||||
|
||||
#------------------
|
||||
# swauth source
|
||||
# -----------------
|
||||
# Versions of swauth in Ubuntu Cloud Archive PPA can be outdated. This
|
||||
# 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"
|
||||
|
||||
#------------------
|
||||
# packages
|
||||
#------------------
|
||||
|
||||
|
||||
# Leveling between distros
|
||||
case platform
|
||||
when "redhat"
|
||||
|
||||
@@ -3,7 +3,7 @@ maintainer "ATT, Inc."
|
||||
license "Apache 2.0"
|
||||
description "Installs and configures Openstack Swift"
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version "7.0.5"
|
||||
version "7.0.6"
|
||||
recipe "openstack-object-storage::setup", "Does initial setup of a swift cluster"
|
||||
recipe "openstack-object-storage::account-server", "Installs the swift account server"
|
||||
recipe "openstack-object-storage::object-server", "Installs the swift object server"
|
||||
|
||||
@@ -26,11 +26,31 @@ include_recipe "openstack-object-storage::ring-repo"
|
||||
platform_options = node["swift"]["platform"]
|
||||
|
||||
if node["swift"]["authmode"] == "swauth"
|
||||
platform_options["swauth_packages"].each.each do |pkg|
|
||||
package pkg do
|
||||
case node["swift"]["swauth-source"]
|
||||
when "package"
|
||||
package platform_options["swauth_packages"] do
|
||||
action :install
|
||||
only_if { node["swift"]["authmode"] == "swauth" }
|
||||
options platform_options["override_options"] # retain configs
|
||||
end
|
||||
when "git"
|
||||
git "#{Chef::Config[:file_cache_path]}/swauth" do
|
||||
repository node["swift"]["swauth_repository"]
|
||||
revision node["swift"]["swauth_version"]
|
||||
action :sync
|
||||
only_if { node["swift"]["authmode"] == "swauth" }
|
||||
end
|
||||
|
||||
bash "install_swauth" do
|
||||
cwd "#{Chef::Config[:file_cache_path]}/swauth"
|
||||
user "root"
|
||||
group "root"
|
||||
code <<-EOH
|
||||
python setup.py install
|
||||
EOH
|
||||
environment 'PREFIX' => "/usr/local"
|
||||
only_if { node["swift"]["authmode"] == "swauth" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -48,11 +48,33 @@ platform_options["proxy_packages"].each do |pkg|
|
||||
end
|
||||
end
|
||||
|
||||
package "python-swauth" do
|
||||
action :install
|
||||
only_if { node["swift"]["authmode"] == "swauth" }
|
||||
case node["swift"]["swauth-source"]
|
||||
when "package"
|
||||
package platform_options["swauth_packages"] do
|
||||
action :install
|
||||
only_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"]
|
||||
action :sync
|
||||
only_if { node["swift"]["authmode"] == "swauth" }
|
||||
end
|
||||
|
||||
bash "install_swauth" do
|
||||
cwd "#{Chef::Config[:file_cache_path]}/swauth"
|
||||
user "root"
|
||||
group "root"
|
||||
code <<-EOH
|
||||
python setup.py install
|
||||
EOH
|
||||
environment 'PREFIX' => "/usr/local"
|
||||
only_if { node["swift"]["authmode"] == "swauth" }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
package "python-swift-informant" do
|
||||
action :install
|
||||
only_if { node["swift"]["use_informant"] }
|
||||
|
||||
@@ -43,9 +43,30 @@ platform_options["proxy_packages"].each do |pkg|
|
||||
end
|
||||
end
|
||||
|
||||
package "python-swauth" do
|
||||
action :upgrade
|
||||
only_if { node["swift"]["authmode"] == "swauth" }
|
||||
case node["swift"]["swauth-source"]
|
||||
when "package"
|
||||
package platform_options["swauth_packages"] do
|
||||
action :upgrade
|
||||
only_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"]
|
||||
action :sync
|
||||
only_if { node["swift"]["authmode"] == "swauth" }
|
||||
end
|
||||
|
||||
bash "install_swauth" do
|
||||
cwd "#{Chef::Config[:file_cache_path]}/swauth"
|
||||
user "root"
|
||||
group "root"
|
||||
code <<-EOH
|
||||
python setup.py install
|
||||
EOH
|
||||
environment 'PREFIX' => "/usr/local"
|
||||
only_if { node["swift"]["authmode"] == "swauth" }
|
||||
end
|
||||
end
|
||||
|
||||
package "python-swift-informant" do
|
||||
|
||||
@@ -15,6 +15,9 @@ describe 'openstack-object-storage::management-server' do
|
||||
@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'
|
||||
|
||||
@chef_run.converge "openstack-object-storage::management-server"
|
||||
end
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ describe 'openstack-object-storage::proxy-server' do
|
||||
@node = @chef_run.node
|
||||
@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'
|
||||
@chef_run.converge "openstack-object-storage::proxy-server"
|
||||
@@ -28,7 +30,7 @@ describe 'openstack-object-storage::proxy-server' do
|
||||
end
|
||||
|
||||
it "installs swauth package if swauth is selected" do
|
||||
expect(@chef_run).to install_package "python-swauth"
|
||||
expect(@chef_run).to install_package "swauth"
|
||||
end
|
||||
|
||||
it "starts swift-proxy on boot" do
|
||||
|
||||
Reference in New Issue
Block a user