From 07dfc20292059583217900cbec78838ba954dd26 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Thu, 5 Apr 2018 17:40:35 -0700 Subject: [PATCH] Allow externally managed swift as glance backend It is possible to have an accessible swift API that is not managed by kolla-ansible -- for example, ceph exposes a swift API, and using that requires setting swift as the glance backend. So, we should loosen the requirement that using the swift backend for glance requires swift be enabled in kolla-ansible. Co-Authored-By: Adam Harwell Change-Id: I17076d5412d2b1e1f13bb0badceaca85a5cee108 --- ansible/roles/glance/defaults/main.yml | 2 +- ansible/roles/glance/templates/glance-api.conf.j2 | 4 ++-- ...-external-swift-as-glance-backend-242a6dbf7c830d7a.yaml | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/allow-external-swift-as-glance-backend-242a6dbf7c830d7a.yaml diff --git a/ansible/roles/glance/defaults/main.yml b/ansible/roles/glance/defaults/main.yml index a23d9c65a9..e13dd3187c 100644 --- a/ansible/roles/glance/defaults/main.yml +++ b/ansible/roles/glance/defaults/main.yml @@ -93,7 +93,7 @@ glance_backends: - name: cinder enabled: "{{ enable_cinder | bool }}" - name: "swift" - enabled: "{{ enable_swift | bool and glance_backend_swift | bool }}" + enabled: "{{ glance_backend_swift | bool }}" glance_store_backends: "{{ glance_backends|selectattr('enabled', 'equalto', true)|list }}" diff --git a/ansible/roles/glance/templates/glance-api.conf.j2 b/ansible/roles/glance/templates/glance-api.conf.j2 index e0853fdadd..56f4487781 100644 --- a/ansible/roles/glance/templates/glance-api.conf.j2 +++ b/ansible/roles/glance/templates/glance-api.conf.j2 @@ -45,7 +45,7 @@ flavor = keystone default_store = vsphere {% elif glance_backend_ceph | bool %} default_store = rbd -{% elif enable_swift | bool and glance_backend_swift | bool %} +{% elif glance_backend_swift | bool %} default_store = swift+http {% else %} default_store = file @@ -62,7 +62,7 @@ rbd_store_pool = {{ ceph_glance_pool_name }} rbd_store_chunk_size = 8 {% endif %} -{% if enable_swift | bool and glance_backend_swift | bool %} +{% if glance_backend_swift | bool %} swift_store_container = glance swift_store_multiple_containers_seed = 0 swift_store_multi_tenant = False diff --git a/releasenotes/notes/allow-external-swift-as-glance-backend-242a6dbf7c830d7a.yaml b/releasenotes/notes/allow-external-swift-as-glance-backend-242a6dbf7c830d7a.yaml new file mode 100644 index 0000000000..f0a5340bf0 --- /dev/null +++ b/releasenotes/notes/allow-external-swift-as-glance-backend-242a6dbf7c830d7a.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Allow overriding the variable `glance_backend_swift` to enable the swift + backend for glance, without requiring swift to be enabled in kolla-ansible. + This allows operators to enable an external swift endpoint as the glance + backend.