ceph-nfs: fix keyring copy for external ganesha

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>
pull/5341/head
Dimitri Savineau 2020-05-05 10:46:14 -04:00 committed by Dimitri Savineau
parent cf460274c7
commit 748ac4b928
1 changed files with 5 additions and 2 deletions

View File

@ -33,11 +33,14 @@
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