mirror of https://github.com/ceph/ceph-ansible.git
ceph-nfs: fix internal ganesha deployment
Sincepull/5341/headea2b654d9
we're not running the rados command from the monitor nodes but from the ganesha node. Unfortunately we don't have the required keyring on that node to run the rados command as we don't import the right keyring. This commit restores the workflow for internal ganesha deployment like beforeea2b654d9
but keeps the rados commands from the ganesha node for external deployment until we have a better design. Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
parent
748ac4b928
commit
8a890306ad
|
@ -1,8 +1,16 @@
|
|||
---
|
||||
- block:
|
||||
- name: set_fact container_exec_cmd_nfs
|
||||
- name: set_fact container_exec_cmd_nfs - external
|
||||
set_fact:
|
||||
exec_cmd_nfs: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph/:/var/lib/ceph/:z -v /var/log/ceph/:/var/log/ceph/:z --entrypoint=rados ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'rados' }} -n client.{{ ceph_nfs_ceph_user if groups.get(mon_group_name, []) | length == 0 else 'rgw.' + ansible_hostname }} -k /var/lib/ceph/radosgw/{{ cluster + '-rgw.' + ceph_nfs_ceph_user if groups.get(mon_group_name, []) | length == 0 else ansible_hostname }}/keyring"
|
||||
exec_cmd_nfs: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph/:/var/lib/ceph/:z -v /var/log/ceph/:/var/log/ceph/:z --entrypoint=rados ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'rados' }} -n client.{{ ceph_nfs_ceph_user }} -k /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ceph_nfs_ceph_user }}/keyring"
|
||||
delegate_node: "{{ inventory_hostname }}"
|
||||
when: groups.get(mon_group_name, []) | length == 0
|
||||
|
||||
- name: set_fact container_exec_cmd_nfs - internal
|
||||
set_fact:
|
||||
exec_cmd_nfs: "{{ container_binary + ' exec ceph-mon-' + hostvars[groups[mon_group_name][0]]['ansible_hostname'] if containerized_deployment | bool else '' }} rados"
|
||||
delegate_node: "{{ groups[mon_group_name][0] }}"
|
||||
when: groups.get(mon_group_name, []) | length > 0
|
||||
|
||||
- name: check if rados index object exists
|
||||
shell: "{{ exec_cmd_nfs | default('') }} -p {{ cephfs_data_pool.name }} --cluster {{ cluster }} ls|grep {{ ceph_nfs_rados_export_index }}"
|
||||
|
@ -11,6 +19,7 @@
|
|||
register: rados_index_exists
|
||||
check_mode: no
|
||||
when: ceph_nfs_rados_backend | bool
|
||||
delegate_to: "{{ delegate_node }}"
|
||||
run_once: true
|
||||
|
||||
- name: create an empty rados index object
|
||||
|
@ -18,6 +27,7 @@
|
|||
when:
|
||||
- ceph_nfs_rados_backend | bool
|
||||
- rados_index_exists.rc != 0
|
||||
delegate_to: "{{ delegate_node }}"
|
||||
run_once: true
|
||||
|
||||
- name: create /etc/ganesha
|
||||
|
|
Loading…
Reference in New Issue