-Add swift store options.

-Updated glance_service definition to use upstart scripts.
This commit is contained in:
Dan Prince 2011-04-18 13:57:26 -04:00
parent 283816600d
commit cae3312660
3 changed files with 39 additions and 14 deletions

View File

@ -17,5 +17,11 @@ default[:glance][:sql_idle_timeout] = "3600"
default[:glance][:default_store] = "file"
default[:glance][:filesystem_store_datadir] = "/var/lib/glance/images"
default[:glance][:swift_store_auth_address] = "127.0.0.1:8080/v1.0/"
default[:glance][:swift_store_user] = "jdoe"
default[:glance][:swift_store_key] = "a86850deb2742ec3cb41518e26aa2d89"
default[:glance][:swift_store_container] = "glance"
default[:glance][:swift_store_create_container_on_put] = "False"
# automatically glance upload the tty linux image. (glance::setup recipe)
default[:glance][:tty_linux_image] = "http://images.ansolabs.com/tty.tgz"

View File

@ -1,13 +1,14 @@
define :glance_service do
service_name="glance-#{params[:name]}"
pidfile="#{node[:glance][:pid_directory]}/#{service_name}.pid"
glance_name="glance-#{params[:name]}"
service service_name do
start_command "cd #{node[:glance][:working_directory]} && su -c 'glance-control #{params[:name]} start --pid-file=#{pidfile}' glance"
stop_command "su -c 'glance-control #{params[:name]} stop --pid-file=#{pidfile}' glance"
restart_command "su -c 'glance-control #{params[:name]} restart --pid-file=#{pidfile}' glance"
status_command "pgrep #{service_name}"
service glance_name do
if (platform?("ubuntu") && node.platform_version.to_f >= 10.04)
restart_command "restart #{glance_name}"
stop_command "stop #{glance_name}"
start_command "start #{glance_name}"
status_command "status #{glance_name} | cut -d' ' -f2 | cut -d'/' -f1 | grep start"
end
supports :status => true, :restart => true
action :start
subscribes :restart, resources(:template => "/etc/glance/glance.conf")

View File

@ -1,6 +1,3 @@
#--working_directory=<%= node[:glance][:working_directory] %>
#--logdir=<%= node[:glance][:logdir] %>
[DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = <%= node[:glance][:verbose] %>
@ -11,10 +8,6 @@ debug = <%= node[:glance][:debug] %>
[app:glance-api]
paste.app_factory = glance.server:app_factory
# Directory that the Filesystem backend store
# writes image data to
filesystem_store_datadir=<%= node[:glance][:filesystem_store_datadir] %>
# Which backend store should Glance use by default is not specified
# in a request to add a new image to Glance? Default: 'file'
# Available choices are 'file', 'swift', and 's3'
@ -32,6 +25,31 @@ registry_host = <%= node[:glance][:registry_host] %>
# Port the registry server is listening on
registry_port = <%= node[:glance][:registry_bind_port] %>
# ============ Filesystem Store Options ========================
# Directory that the Filesystem backend store
# writes image data to
filesystem_store_datadir=<%= node[:glance][:filesystem_store_datadir] %>
# ============ Swift Store Options =============================
# Address where the Swift authentication service lives
swift_store_auth_address = <%= node[:glance][:swift_store_auth_address] %>
# User to authenticate against the Swift authentication service
swift_store_user = <%= node[:glance][:swift_store_user] %>
# Auth key for the user authenticating against the
# Swift authentication service
swift_store_key = <%= node[:glance][:swift_store_key] %>
# Container within the account that the account should use
# for storing images in Swift
swift_store_container = <%= node[:glance][:swift_store_container] %>
# Do we create the container if it does not exist?
swift_store_create_container_on_put = <%= node[:glance][:swift_store_create_container_on_put] %>
[app:glance-registry]
paste.app_factory = glance.registry.server:app_factory