From 58f49a8a2d488f3e550a6e6e4c0880964c6ccaf8 Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Mon, 5 Mar 2018 18:25:52 +0000 Subject: [PATCH] Avoid putting rgw conf on ALL hosts To avoid adding unnecessary RGW configuration to hosts that don't require it we should separate out the rgw_overrides to only apply to ceph.conf on RGW hosts. Additionally, the radosgw_dns_name var is no longer used by ceph-ansible or OSA in any way, so this has been cleaned up and removed. Change-Id: I243e742da3bf7d1e452998f257f7d0804e13237b --- inventory/group_vars/ceph-rgw.yml | 33 ++++++++++++++++++++ inventory/group_vars/ceph_all.yml | 50 +++---------------------------- 2 files changed, 37 insertions(+), 46 deletions(-) create mode 100644 inventory/group_vars/ceph-rgw.yml diff --git a/inventory/group_vars/ceph-rgw.yml b/inventory/group_vars/ceph-rgw.yml new file mode 100644 index 0000000000..d5fb0800fa --- /dev/null +++ b/inventory/group_vars/ceph-rgw.yml @@ -0,0 +1,33 @@ +--- +radosgw_service_name: "radosgw" +radosgw_service_type: "object-store" +radosgw_service_description: "Object Storage Service" +radosgw_service_region: "{{ service_region }}" +radosgw_admin_user: radosgw +radosgw_admin_tenant: service + +radosgw_service_port: "{{ (groups['swift_proxy'] is defined and groups['swift_proxy'] | length > 0) | ternary(7980,8080) }}" +radosgw_address: "{{ container_address }}" +radosgw_service_proto: http +radosgw_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(radosgw_service_proto) }}" +radosgw_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(radosgw_service_proto) }}" +radosgw_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(radosgw_service_proto) }}" +radosgw_service_publicuri: "{{ radosgw_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ radosgw_service_port }}" +radosgw_service_publicurl: "{{ radosgw_service_publicuri }}/swift/v1" +radosgw_service_adminuri: "{{ radosgw_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ radosgw_service_port }}" +radosgw_service_adminurl: "{{ radosgw_service_adminuri }}/swift/v1" +radosgw_service_internaluri: "{{ radosgw_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ radosgw_service_port }}" +radosgw_service_internalurl: "{{ radosgw_service_internaluri }}/swift/v1" + +ceph_conf_overrides_rgw: + "client.rgw.{{ hostvars[inventory_hostname]['ansible_hostname'] }}": + # OpenStack integration with Keystone + rgw_keystone_url: "{{ keystone_service_adminuri }}" + rgw_keystone_api_version: 3 + rgw_keystone_admin_user: "{{ radosgw_admin_user }}" + rgw_keystone_admin_password: "{{ radosgw_admin_password }}" + rgw_keystone_admin_tenant: "{{ radosgw_admin_tenant }}" + rgw_keystone_admin_domain: default + rgw_keystone_accepted_roles: 'Member, _member_, admin, swiftoperator' + rgw_s3_auth_use_keystone: true + rgw_enable_apis: swift diff --git a/inventory/group_vars/ceph_all.yml b/inventory/group_vars/ceph_all.yml index f706257727..761c4a5791 100644 --- a/inventory/group_vars/ceph_all.yml +++ b/inventory/group_vars/ceph_all.yml @@ -18,49 +18,7 @@ ceph_container_bind_mounts: - bind_dir_path: "/var/lib/ceph" mount_path: "/openstack/{{ inventory_hostname }}" -# Disable the NFS gateway PPA and package install by default as it is not -# needed. -nfs_file_gw: False -nfs_obj_gw: False - -# radosgw - -radosgw_service_name: "radosgw" -radosgw_service_type: "object-store" -radosgw_service_description: "Object Storage Service" -radosgw_service_region: "{{ service_region }}" -radosgw_admin_user: radosgw -radosgw_admin_tenant: service - -radosgw_service_port: "{{ (groups['swift_proxy'] is defined and groups['swift_proxy'] | length > 0) | ternary(7980,8080) }}" -radosgw_address: "{{ container_address }}" -radosgw_service_proto: http -radosgw_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(radosgw_service_proto) }}" -radosgw_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(radosgw_service_proto) }}" -radosgw_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(radosgw_service_proto) }}" -radosgw_service_publicuri: "{{ radosgw_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ radosgw_service_port }}" -radosgw_service_publicurl: "{{ radosgw_service_publicuri }}/swift/v1" -radosgw_service_adminuri: "{{ radosgw_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ radosgw_service_port }}" -radosgw_service_adminurl: "{{ radosgw_service_adminuri }}/swift/v1" -radosgw_service_internaluri: "{{ radosgw_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ radosgw_service_port }}" -radosgw_service_internalurl: "{{ radosgw_service_internaluri }}/swift/v1" - -# This is the endpoint hostname that will be configured in the Keystone catalog for object storage -radosgw_dns_name: "{{ ansible_host }}" -# To extend ceph_conf_overrides while keeping this configuration, create a -# dict of config_template style overrides for ceph.conf in a var, ie. -# ceph_conf_overrides_custom, then use: -# ceph_conf_overrides: "{{ ceph_conf_overrides_rgw | combine(ceph_conf_overrides_custom, recursive=True) }}" -ceph_conf_overrides: "{{ ceph_conf_overrides_rgw }}" -ceph_conf_overrides_rgw: - "client.rgw.{{ hostvars[inventory_hostname]['ansible_hostname'] }}": - # OpenStack integration with Keystone - rgw_keystone_url: "{{ keystone_service_adminuri }}" - rgw_keystone_api_version: 3 - rgw_keystone_admin_user: "{{ radosgw_admin_user }}" - rgw_keystone_admin_password: "{{ radosgw_admin_password }}" - rgw_keystone_admin_tenant: "{{ radosgw_admin_tenant }}" - rgw_keystone_admin_domain: default - rgw_keystone_accepted_roles: 'Member, _member_, admin, swiftoperator' - rgw_s3_auth_use_keystone: true - rgw_enable_apis: swift +# To extend ceph_conf_overrides use the ceph_conf_overrides_custom which will +# combine any ceph_conf_overrides with other RGW specific overrides. +ceph_conf_overrides_custom: {} +ceph_conf_overrides: "{{ (ceph_conf_overrides_rgw | default({})) | combine(ceph_conf_overrides_custom, recursive=True) }}"