]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
dashboard: fix rgw user creation
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 3 Jun 2021 08:11:30 +0000 (10:11 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 3 Jun 2021 15:07:02 +0000 (17:07 +0200)
When deploying dashboard in a cluster with rgw multisite deployed.
Due to the last rgw multisite refactor, we now expect the variable
`rgw_zonemaster` to be defined in the dict `rgw_instances`.
The idea here is to create that user on the cluster as soon as we have 1
`rgw_zonemaster` set to `true` in `rgw_instances`.

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

index 2099a43204719e0aa6e8248736469b03901e9f8c..faed1acc0711c5b1d460947b8ff30042fe232f20 100644 (file)
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: true
       when:
-        - not rgw_multisite | bool or rgw_zonemaster | bool
+        - not rgw_multisite | bool or (true in (rgw_instances | selectattr('rgw_zonemaster', 'defined') | map(attribute='rgw_zonemaster') | list) if rgw_instances is defined else rgw_zonemaster | default(false))
         - get_rgw_user.rc == 22
 
     - name: get the rgw access and secret keys