]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-nfs: fix keyring copy for external ganesha
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 5 May 2020 14:46:14 +0000 (10:46 -0400)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Wed, 6 May 2020 15:10:08 +0000 (11:10 -0400)
Fix the condition on the keyring copy task that prevent the ganesha
keyring to be created in the /var/lib/ceph directory.
Also ensure that the directory exists first.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1831285
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
roles/ceph-nfs/tasks/main.yml

index 39a9b29872ab751fcbdd1aa6209bf2af87248c6e..4cd3bd3e287046bc93cc58324fd4caad75fcbb84 100644 (file)
   block:
     - name: create keyring directory
       file:
-        path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ceph_nfs_ceph_user }}"
+        path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ item }}"
         state: directory
         owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
         group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
         mode: "0755"
+      with_items:
+        - "{{ ceph_nfs_ceph_user }}"
+        - "{{ ansible_hostname }}"
 
     - name: set_fact rgw_client_name
       set_fact:
@@ -55,7 +58,7 @@
         - ['/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ceph_nfs_ceph_user }}/keyring', '/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring']
       when:
         - not item.0.get('skipped', False)
-        - item.0.item.name == 'client.rgw.' + ceph_nfs_ceph_user
+        - item.0.item.name == 'client.' + ceph_nfs_ceph_user or item.0.item.name == rgw_client_name
 
 - name: include start_nfs.yml
   import_tasks: start_nfs.yml