DeepSea
DeepSea copied to clipboard
Handle non default realms in rgw user create
clusters can have other realms configured as default which wouldn't map to the name 'default', we need to create users for the configured default realm. So in a non multisite cluster;
$ radosgw-admin realm list # empty
$ radosgw-admin realm get # -enoent
for a multiste cluster
$ radosgw-admin realm list # json of default realm id and list of realms
$ radosgw-admin realm get # json of default realm
With the above outputs determine the default realms and use this value if populated
The related update would be /srv/salt/ceph/rgw/files/users.j2 where
realm:
default:
{% if salt['file.file_exists']('/srv/salt/ceph/rgw/users/system.user.yml') %}
would become
realm:
{{ salt['rgw.default_realm']() }}:
{% if salt['file.file_exists']('/srv/salt/ceph/rgw/users/system.user.yml') %}
and we need to create a default_realm function. I suspect the users function would need to change its default as well.