]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
cephadm_adopt: create a 'nfs-ganesha' pool
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 26 Apr 2021 07:16:40 +0000 (09:16 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 27 Apr 2021 13:17:28 +0000 (15:17 +0200)
When migrating from a cluster with no MDS nodes deployed,
`{{ cephfs_data_pool.name }}` doesn't exist so we need to create a pool
for storing nfs export objects.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1950403
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit bb7d37fb6aac091ba0e9d7f6b7ad468e177d16b3)

infrastructure-playbooks/cephadm-adopt.yml

index 3965d5ed2cc0ec68fbb4d8c17889a89ea90357bc..9f280ad590b956c14924a5091490b09998b4d7d1 100644 (file)
           {{ nfs_file_gw_export | default('') }}
           {{ nfs_obj_gw_export | default('') }}
 
+    - name: create nfs exports pool
+      ceph_pool:
+        name: "{{ nfs_ganesha_export_pool_name | default('nfs-ganesha') }}"
+        cluster: "{{ cluster }}"
+      delegate_to: "{{ groups[mon_group_name][0] }}"
+      run_once: true
+      environment:
+        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
+        CEPH_CONTAINER_BINARY: "{{ container_binary }}"
+
     - name: push the new exports in a rados object
-      command: "{{ rados_cmd }} -p {{ cephfs_data_pool.name }} -N {{ cephfs_data_pool.name }} put conf-nfs.{{ nfs_group_name | default('nfss') }} -"
+      command: "{{ rados_cmd }} -p {{ nfs_ganesha_export_pool_name | default('nfs-ganesha') }} -N {{ nfs_ganesha_export_namespace | default('nfs-ganesha') }} put conf-nfs.{{ nfs_group_name | default('nfss') }} -"
       args:
         stdin: "{{ new_export }}"
         stdin_add_newline: no
       delegate_to: "{{ groups[mon_group_name][0] }}"
 
     - name: update the placement of nfs hosts
-      command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply nfs {{ nfs_group_name | default('nfss') }} {{ cephfs_data_pool.name }} {{ cephfs_data_pool.name }} --placement='{{ groups.get(nfs_group_name, []) | length }} label:{{ nfs_group_name }}'"
+      command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply nfs {{ nfs_group_name | default('nfss') }} {{ nfs_ganesha_export_pool_name | default('nfs-ganesha') }} {{ nfs_ganesha_export_namespace | default('nfs-ganesha') }} --placement='{{ groups.get(nfs_group_name, []) | length }} label:{{ nfs_group_name }}'"
       run_once: true
       changed_when: false
       delegate_to: "{{ groups[mon_group_name][0] }}"