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.