# do not ever change this here
#rolling_update: false
-
#####################
# Docker pull retry #
#####################
#docker_pull_retry: 3
#docker_pull_timeout: "300s"
+
######################
#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)
# do not ever change this here
#rolling_update: false
-
#####################
# Docker pull retry #
#####################
#docker_pull_retry: 3
#docker_pull_timeout: "300s"
+
######################
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)
---
+- 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
#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 %}
{% 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