From 45c5fe774ff09b435fad45dc21da5ed95b52e226 Mon Sep 17 00:00:00 2001
From: Andy McCrae <andy.mccrae@gmail.com>
Date: Wed, 29 Apr 2015 17:29:26 +0100
Subject: [PATCH] Default glance swift_backend to use local swift

The default values should use the local swift installation, since these
are only used when the glance backend is set to "swift" it won't matter
if there is no local swift when the backend is set to "file".

Adjust AIO script to use the defaults.

Move the configuration values from user_secrets.yml into
user_variables.yml since these are not passwords that should be set.
Additionally comment them out by default.

Change-Id: I579500a0287bc29f27fdbdb4f810212a2e194dea
Closes-Bug: #1450117
---
 defaults/main.yml | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/defaults/main.yml b/defaults/main.yml
index bb58d225..33d6a4ad 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -42,18 +42,6 @@ glance_enable_v1_registry: True
 glance_enable_v2_api: True
 glance_enable_v2_registry: True
 
-
-## Swift Options
-glance_swift_store_auth_address: NoAuthAddress
-glance_swift_store_user: NoUser
-glance_swift_store_key: NoKey
-glance_swift_store_region: NoRegion
-glance_swift_store_container: NoContainer
-glance_swift_store_endpoint_type: internalURL
-# Set the swift_store_large_objects variables in MB
-glance_swift_store_large_object_size: 5120
-glance_swift_store_large_object_chunk_size: 200
-
 ## DB info
 glance_galera_database: glance
 glance_galera_user: glance
@@ -85,6 +73,17 @@ glance_service_internalurl: "{{ glance_service_internaluri }}"
 glance_service_adminuri: "{{ glance_service_proto }}://{{ internal_lb_vip_address }}:{{ glance_service_port }}"
 glance_service_adminurl: "{{ glance_service_adminuri }}"
 
+## Swift Options
+glance_swift_store_auth_address: "{{ keystone_service_internalurl }}"
+glance_swift_store_user: "service:{{ glance_service_user_name }}"
+glance_swift_store_key: "{{ glance_service_password }}"
+glance_swift_store_region: "{{ glance_service_region }}"
+glance_swift_store_container: glance_images
+glance_swift_store_endpoint_type: internalURL
+# Set the swift_store_large_objects variables in MB
+glance_swift_store_large_object_size: 5120
+glance_swift_store_large_object_chunk_size: 200
+
 ## Keystone authentication middleware
 glance_keystone_auth_plugin: password