]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Allow to use rados for ganesha exports 2177/head
authorJan Provaznik <jprovazn@redhat.com>
Wed, 15 Nov 2017 11:59:36 +0000 (12:59 +0100)
committerJan Provaznik <jprovazn@redhat.com>
Tue, 21 Nov 2017 14:21:32 +0000 (15:21 +0100)
group_vars/all.yml.sample
group_vars/nfss.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-nfs/defaults/main.yml
roles/ceph-nfs/tasks/start_nfs.yml
roles/ceph-nfs/templates/ganesha.conf.j2

index 2a75fa6bb1abe4a0878d080162270159b7beb92d..6504ba5c58412b00ecc0e8963c8dac2d7fc8d35f 100644 (file)
@@ -497,9 +497,9 @@ dummy:
 # do not ever change this here
 #rolling_update: false
 
-
 #####################
 # Docker pull retry #
 #####################
 #docker_pull_retry: 3
 #docker_pull_timeout: "300s"
+
index 4ec3a38a43de26621ae1e9c401a0694e1579f961..e0f3baeb49ddcb76b8b4e534edb215bcab9531f4 100644 (file)
@@ -44,6 +44,14 @@ dummy:
 ######################
 #ceph_nfs_log_file: "/var/log/ganesha/ganesha.log"
 #ceph_nfs_dynamic_exports: false
+# If set to true then rados is used to store ganesha exports
+# and client sessions information, this is useful if you
+# run multiple nfs-ganesha servers in active/passive mode and
+# want to do failover
+#ceph_nfs_rados_backend: false
+# Name of the rados object used to store a list of the export rados
+# object URLS
+#ceph_nfs_rados_export_index: "ganesha-export-index"
 # Address ganesha service should listen on, by default ganesha listens on all
 # addresses. (Note: ganesha ignores this parameter in current version due to
 # this bug: https://github.com/nfs-ganesha/nfs-ganesha/issues/217)
index f95d195b261f5d2c27146570c7f45e3f9786b483..8dfce845ceaa62e5037908366c1b5ed22421a2d4 100644 (file)
@@ -497,9 +497,9 @@ ceph_repository: rhcs
 # do not ever change this here
 #rolling_update: false
 
-
 #####################
 # Docker pull retry #
 #####################
 #docker_pull_retry: 3
 #docker_pull_timeout: "300s"
+
index 6bbcf47e8aca0feb1d337fb6c371a79eac95c56d..84723d1dca37456f167f4610f0096dd8a1127648 100644 (file)
@@ -36,6 +36,14 @@ nfs_obj_gw: true
 ######################
 ceph_nfs_log_file: "/var/log/ganesha/ganesha.log"
 ceph_nfs_dynamic_exports: false
+# If set to true then rados is used to store ganesha exports
+# and client sessions information, this is useful if you
+# run multiple nfs-ganesha servers in active/passive mode and
+# want to do failover
+ceph_nfs_rados_backend: false
+# Name of the rados object used to store a list of the export rados
+# object URLS
+ceph_nfs_rados_export_index: "ganesha-export-index"
 # Address ganesha service should listen on, by default ganesha listens on all
 # addresses. (Note: ganesha ignores this parameter in current version due to
 # this bug: https://github.com/nfs-ganesha/nfs-ganesha/issues/217)
index b1bed643ebfe3a4478d7a941c2725c72c262f25b..aaf377d63526ff6a1eac5547f15c67e4d7e3e7d1 100644 (file)
@@ -1,4 +1,19 @@
 ---
+- name: check if rados index object exists
+  shell: "rados -p {{ cephfs_data }} --cluster {{ cluster }} ls|grep {{ ceph_nfs_rados_export_index }}"
+  changed_when: false
+  failed_when: false
+  register: rados_index_exists
+  check_mode: no
+  when:
+    - ceph_nfs_rados_backend
+
+- name: create an empty rados index object
+  shell: "echo | rados -p {{ cephfs_data }} --cluster {{ cluster }} put {{ ceph_nfs_rados_export_index }} -"
+  when:
+    - ceph_nfs_rados_backend
+    - rados_index_exists.rc != 0
+
 - name: create /etc/ganesha
   file:
     path: /etc/ganesha
index 7792de5dbf35e85262491c74e5ef269638a41d23..8e05f793debf2adf02066899feda695a82f03f4e 100644 (file)
@@ -1,7 +1,7 @@
 #jinja2: trim_blocks: "true", lstrip_blocks: "true"
 # {{ ansible_managed }}
 
-{% if ceph_nfs_dynamic_exports %}
+{% if ceph_nfs_dynamic_exports and not ceph_nfs_rados_backend %}
 %include /etc/ganesha/export.d/INDEX.conf
 {% endif %}
 
@@ -12,6 +12,22 @@ NFS_Core_Param
 {% endif %}
 }
 
+{% if ceph_nfs_rados_backend %}
+RADOS_URLS {
+   ceph_conf = '/etc/ceph/{{ cluster }}.conf';
+   userid = "{{ ceph_nfs_ceph_user }}";
+}
+%url rados://{{ cephfs_data }}/{{ ceph_nfs_rados_export_index }}
+
+NFSv4 {
+       RecoveryBackend = 'rados_kv';
+}
+RADOS_KV {
+       ceph_conf = '/etc/ceph/{{ cluster }}.conf';
+       userid = "{{ ceph_nfs_ceph_user }}";
+       pool = "{{ cephfs_data }}";
+}
+{% endif %}
 
 {% if nfs_file_gw %}
 EXPORT