From 2ce46e4767b74668e776aee0dd90df02aee25fb7 Mon Sep 17 00:00:00 2001 From: "tone.zhang" Date: Wed, 25 Jul 2018 10:14:31 +0800 Subject: [PATCH] Improve ceph-rgw compatibility with Swift API in Kolla-ansible By default ceph-rgw is not completely comaptible with Swift API, because of the restriction for Swift INFO API.[0] The patch improve ceph-rgw compatibility with Swift API. It is controlled by the option "ceph_rgw_compatibility" in ansible/group_vars/all.yml. After changing the option, run the "reconfigure" command to enable. Closes-Bug: #1783456 [0] https://github.com/ceph/ceph/pull/17967 Change-Id: Ibf3eb52280e197965caef08a44ae226c4f884cb5 Signed-off-by: tone.zhang --- ansible/group_vars/all.yml | 4 ++++ ansible/roles/ceph/defaults/main.yml | 6 +++--- ansible/roles/ceph/tasks/reconfigure.yml | 5 +++++ ansible/roles/ceph/templates/ceph.conf.j2 | 4 ++++ doc/source/reference/ceph-guide.rst | 10 ++++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 0e09a1af06..f5cf29c7a3 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -774,6 +774,10 @@ ceph_pool_type: "replicated" # Integrate Ceph Rados Object Gateway with OpenStack keystone enable_ceph_rgw_keystone: "no" +# Enable/disable ceph-rgw compatibility with OpenStack Swift +# Valid options are [ True, False ] +ceph_rgw_compatibility: "False" + ceph_cinder_pool_name: "volumes" ceph_cinder_backup_pool_name: "backups" ceph_glance_pool_name: "images" diff --git a/ansible/roles/ceph/defaults/main.yml b/ansible/roles/ceph/defaults/main.yml index 950a8a7b18..34563286c0 100644 --- a/ansible/roles/ceph/defaults/main.yml +++ b/ansible/roles/ceph/defaults/main.yml @@ -63,9 +63,9 @@ partition_name_osd_data: "{{ 'KOLLA_CEPH_BSDATA' if ceph_osd_store_type == 'blue #################### ## Ceph_rgw_keystone #################### -swift_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ rgw_port }}/swift/v1" -swift_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ rgw_port }}/swift/v1" -swift_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ rgw_port }}/swift/v1" +swift_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ rgw_port }}{{ '/' if ceph_rgw_compatibility|bool else '/swift/' }}v1" +swift_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ rgw_port }}{{ '/' if ceph_rgw_compatibility|bool else '/swift/' }}v1" +swift_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ rgw_port }}{{ '/' if ceph_rgw_compatibility|bool else '/swift/' }}v1" ceph_rgw_keystone_user: "ceph_rgw" diff --git a/ansible/roles/ceph/tasks/reconfigure.yml b/ansible/roles/ceph/tasks/reconfigure.yml index a4832495a9..c750ea8b89 100644 --- a/ansible/roles/ceph/tasks/reconfigure.yml +++ b/ansible/roles/ceph/tasks/reconfigure.yml @@ -224,3 +224,8 @@ with_together: - "{{ ceph_rgw_container_envs.results }}" - "{{ ceph_rgw_check_results.results }}" + +- include_tasks: start_rgw_keystone.yml + when: + - ceph_rgw_container_envs.results + - enable_ceph_rgw_keystone | bool diff --git a/ansible/roles/ceph/templates/ceph.conf.j2 b/ansible/roles/ceph/templates/ceph.conf.j2 index 8df2dc0c77..118450ae32 100644 --- a/ansible/roles/ceph/templates/ceph.conf.j2 +++ b/ansible/roles/ceph/templates/ceph.conf.j2 @@ -43,4 +43,8 @@ rgw_keystone_accepted_roles = admin, {{ keystone_default_user_role }} {% endif %} keyring = /etc/ceph/ceph.client.radosgw.keyring log file = /var/log/kolla/ceph/client.radosgw.gateway.log +{% if ceph_rgw_compatibility | bool %} +rgw_swift_url_prefix = "/" +rgw_enable_apis = swift,swift_auth,admin +{% endif %} {% endif %} diff --git a/doc/source/reference/ceph-guide.rst b/doc/source/reference/ceph-guide.rst index e8f9d2511f..8564314206 100644 --- a/doc/source/reference/ceph-guide.rst +++ b/doc/source/reference/ceph-guide.rst @@ -187,6 +187,16 @@ RadosGW is optional, enable it in ``/etc/kolla/globals.yml``: .. end +.. note:: + + By default RadosGW supports both Swift and S3 API, and it is not + completely compatible with Swift API. The option `ceph_rgw_compatibility` + in ``ansible/group_vars/all.yml`` can enable/disable the RadosGW + compatibility with Swift API completely. After changing the value, run the + "reconfigureā€œ command to enable. + +.. end + Configure the Ceph store type in ``ansible/group_vars/all.yml``, the default value is ``bluestore`` in Rocky: