From 75a97c51a7093e6a56f71610a89f19f2ab119f9b Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Tue, 9 Sep 2014 15:37:23 +0100 Subject: [PATCH] Glance configuration changes This change makes notification_driver configurable and only writes messaging configuration options to glance-api.conf if notification_driver is set to 'messaging' (it defaults to 'noop'). We also set a default value for 'swift_store_endpoint_type' so that an ansible run will not bomb if the user does not have 'glance_swift_store_endpoint_type' defined in their user_variables.yml file. --- etc/rpc_deploy/user_variables.yml | 1 + rpc_deployment/inventory/group_vars/glance_all.yml | 2 ++ .../roles/glance_common/templates/glance-api.conf | 8 +++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/etc/rpc_deploy/user_variables.yml b/etc/rpc_deploy/user_variables.yml index 4db1af0ff6..7b8f8f6a05 100644 --- a/etc/rpc_deploy/user_variables.yml +++ b/etc/rpc_deploy/user_variables.yml @@ -65,6 +65,7 @@ glance_swift_store_region: SomeRegion # `internalURL` will cause glance to speak to swift via ServiceNet, use # `publicURL` to communicate with swift over the public network glance_swift_store_endpoint_type: internalURL +glance_notification_driver: noop ## Heat Options diff --git a/rpc_deployment/inventory/group_vars/glance_all.yml b/rpc_deployment/inventory/group_vars/glance_all.yml index 130589006e..5a5c048163 100644 --- a/rpc_deployment/inventory/group_vars/glance_all.yml +++ b/rpc_deployment/inventory/group_vars/glance_all.yml @@ -40,6 +40,7 @@ container_mysql_password: "{{ glance_container_mysql_password }}" container_database: glance ## RPC +notification_driver: "{{ glance_notification_driver|default('noop') }}" rpc_backend: glance.openstack.common.rpc.impl_kombu ## Backend @@ -51,6 +52,7 @@ swift_store_user: "{{ glance_swift_store_user | default('NoUser') }}" swift_store_key: "{{ glance_swift_store_key | default('NoKey') }}" swift_store_region: "{{ glance_swift_store_region | default('NoRegion') }}" swift_store_container: "{{ glance_swift_store_container | default('NoContainer')}}" +swift_store_endpoint_type: "{{ glance_swift_store_endpoint_type | default('internalURL') }}" ## Auth service_admin_tenant_name: "service" diff --git a/rpc_deployment/roles/glance_common/templates/glance-api.conf b/rpc_deployment/roles/glance_common/templates/glance-api.conf index 2a841c2d33..0f51d3d825 100644 --- a/rpc_deployment/roles/glance_common/templates/glance-api.conf +++ b/rpc_deployment/roles/glance_common/templates/glance-api.conf @@ -18,8 +18,9 @@ registry_port = 9191 registry_client_protocol = http cinder_catalog_info = volume:cinder:internalURL +notification_driver = {{ notification_driver }} +{% if notification_driver == "messaging" %} ##### RPC MESSAGING OPTIONS ##### -notification_driver = messaging rpc_backend = {{ rpc_backend }} rabbit_hosts = {{ rabbit_hosts }} rabbit_port = {{ rabbit_port }} @@ -30,6 +31,7 @@ rabbit_virtual_host = {{ rabbit_virtual_host }} rabbit_notification_exchange = glance rabbit_notification_topic = notifications rabbit_durable_queues = False +{% endif %} {% if default_store == "swift" %} ##### STORE OPTIONS ##### @@ -43,9 +45,9 @@ swift_store_create_container_on_put = True swift_store_large_object_size = 5120 swift_store_large_object_chunk_size = 200 swift_store_retry_get_count = 5 -swift_store_endpoint_type = {{ glance_swift_store_endpoint_type }} - +swift_store_endpoint_type = {{ swift_store_endpoint_type }} {% endif %} + filesystem_store_datadir = /var/lib/glance/images/ delayed_delete = False scrub_time = 43200