]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
nfs/rgw: support enforcing keys v4.0.68
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 13 Oct 2021 08:26:59 +0000 (10:26 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 26 Oct 2021 14:39:58 +0000 (16:39 +0200)
if one sets `ceph_nfs_rgw_access_key` and/or `ceph_nfs_rgw_secret_key`,
the nfs/rgw user creation won't take those variables into account and it
will generate a user with automatically generated credentials.
It ends up with a mismatch between what will be set in ganesha.conf and
the created user.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2010754
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-nfs/tasks/create_rgw_nfs_user.yml

index 06860798c63c08cd10a782045d07fc1776ea3e70..87fdb9fc4caf029d6e06ad2948632ec1418ceef1 100644 (file)
@@ -14,7 +14,7 @@
   when: nfs_obj_gw | bool
 
 - name: create rgw nfs user "{{ ceph_nfs_rgw_user }}"
-  command: "{{ container_exec_cmd_nfs | default('') }} radosgw-admin --cluster {{ cluster }} user create --uid={{ ceph_nfs_rgw_user }} --display-name='RGW NFS User'"
+  command: "{{ container_exec_cmd_nfs | default('') }} radosgw-admin --cluster {{ cluster }} user create --uid={{ ceph_nfs_rgw_user }} --display-name='RGW NFS User' {{ '--access-key=' + ceph_nfs_rgw_access_key if ceph_nfs_rgw_access_key is defined else '' }} {{ '--secret-key=' + ceph_nfs_rgw_secret_key if ceph_nfs_rgw_secret_key is defined else '' }}"
   run_once: true
   register: rgwuser
   changed_when: false