#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C"
+###################
+# CONFIG OVERRIDE #
+###################
+
+# Ganesha configuration file override.
+# These multiline strings will be appended to the contents of the blocks in ganesha.conf and
+# must be in the correct ganesha.conf format seen here:
+# https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/config_samples/ganesha.conf.example
+#
+# Example:
+#CACHEINODE {
+# #Entries_HWMark = 100000;
+#}
+#
+#ganesha_ceph_export_overrides:
+#ganesha_rgw_export_overrides:
+#ganesha_log_overrides:
+#ganesha_conf_overrides: |
+# CACHEINODE {
+# #Entries_HWMark = 100000;
+# }
+
##########
# DOCKER #
##########
+++ /dev/null
-#jinja2: trim_blocks: "true", lstrip_blocks: "true"
-# {{ ansible_managed }}
-
-{% if nfs_file_gw %}
-EXPORT
-{
- Export_ID={{ ceph_nfs_ceph_export_id }};
-
- Path = "/";
-
- Pseudo = {{ ceph_nfs_ceph_pseudo_path }};
-
- Access_Type = {{ ceph_nfs_ceph_access_type }};
-
- NFS_Protocols = {{ ceph_nfs_ceph_protocols }};
-
- Transport_Protocols = TCP;
-
- Sectype = sys,krb5,krb5i,krb5p;
-
- FSAL {
- Name = CEPH;
- }
-}
-{% endif %}
-{% if nfs_obj_gw %}
-EXPORT
-{
- Export_ID={{ ceph_nfs_rgw_export_id }};
-
- Path = "/";
-
- Pseudo = {{ ceph_nfs_rgw_pseudo_path }};
-
- Access_Type = {{ ceph_nfs_rgw_access_type }};
-
- NFS_Protocols = {{ ceph_nfs_rgw_protocols }};
-
- Transport_Protocols = TCP;
-
- Sectype = sys,krb5,krb5i,krb5p;
-
- FSAL {
- Name = RGW;
- User_Id = "{{ ceph_nfs_rgw_user }}";
- Access_Key_Id ="{{ ceph_nfs_rgw_access_key }}";
- Secret_Access_Key = "{{ ceph_nfs_rgw_secret_key }}";
- }
-}
-{% endif %}
-
-LOG {
- Facility {
- name = FILE;
- destination = "{{ ceph_nfs_log_file }}";
- enable = active;
- }
-}
# at their disposal, some people might want to have it
# distributed on RGW nodes. Setting 'copy_admin_key' to 'true'
# will copy the admin key to the /etc/ceph/ directory
-copy_admin_key: yes
+copy_admin_key: false
#######################
# Access type options #
#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C"
+###################
+# CONFIG OVERRIDE #
+###################
+
+# Ganesha configuration file override.
+# These multiline strings will be appended to the contents of the blocks in ganesha.conf and
+# must be in the correct ganesha.conf format seen here:
+# https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/config_samples/ganesha.conf.example
+#
+# Example:
+#CACHEINODE {
+ #Entries_HWMark = 100000;
+#}
+#
+#ganesha_ceph_export_overrides:
+#ganesha_rgw_export_overrides:
+#ganesha_log_overrides:
+#ganesha_conf_overrides: |
+# CACHEINODE {
+ #Entries_HWMark = 100000;
+# }
##########
# DOCKER #
- name: generate ganesha configuration file
action: config_template
args:
- src: "{{ lookup('env', 'ANSIBLE_ROLES_PATH') | default (playbook_dir + '/roles', true) }}/ceph-common/templates/ganesha.conf.j2"
+ src: "{{ lookup('env', 'ANSIBLE_ROLES_PATH') | default (playbook_dir + '/roles', true) }}/ceph-nfs/templates/ganesha.conf.j2"
dest: /etc/ganesha/ganesha.conf
owner: "root"
group: "root"
mode: "0644"
config_type: ini
+ notify:
+ - restart ceph nfss
+
+- name: cat ganesha conf file to view overrides
+ command: cat /etc/ganesha/ganesha.conf
- name: start nfs gateway service
service:
--- /dev/null
+#jinja2: trim_blocks: "true", lstrip_blocks: "true"
+# {{ ansible_managed }}
+
+{% if nfs_file_gw %}
+EXPORT
+{
+ Export_ID={{ ceph_nfs_ceph_export_id }};
+
+ Path = "/";
+
+ Pseudo = {{ ceph_nfs_ceph_pseudo_path }};
+
+ Access_Type = {{ ceph_nfs_ceph_access_type }};
+
+ Protocols = {{ ceph_nfs_ceph_protocols }};
+
+ Transports = TCP;
+
+ Sectype = sys,krb5,krb5i,krb5p;
+
+ FSAL {
+ Name = CEPH;
+ }
+
+ {{ ganesha_ceph_export_overrides | default(None) }}
+}
+{% endif %}
+{% if nfs_obj_gw %}
+EXPORT
+{
+ Export_ID={{ ceph_nfs_rgw_export_id }};
+
+ Path = "/";
+
+ Pseudo = {{ ceph_nfs_rgw_pseudo_path }};
+
+ Access_Type = {{ ceph_nfs_rgw_access_type }};
+
+ Protocols = {{ ceph_nfs_rgw_protocols }};
+
+ Transports = TCP;
+
+ Sectype = sys,krb5,krb5i,krb5p;
+
+ FSAL {
+ Name = RGW;
+ User_Id = "{{ ceph_nfs_rgw_user }}";
+ Access_Key_Id ="{{ ceph_nfs_rgw_access_key }}";
+ Secret_Access_Key = "{{ ceph_nfs_rgw_secret_key }}";
+ }
+
+ {{ ganesha_rgw_export_overrides | default(None) }}
+
+}
+{% endif %}
+
+LOG {
+ Facility {
+ name = FILE;
+ destination = "{{ ceph_nfs_log_file }}";
+ enable = active;
+ }
+
+ {{ ganesha_log_overrides | default(None) }}
+}
+
+{{ ganesha_conf_overrides | default(None) }}
copy_admin_key: true
nfs_file_gw: false
nfs_obj_gw: true
+ganesha_conf_overrides: |
+ CACHEINODE {
+ Entries_HWMark = 100000;
+ }
@pytest.mark.no_docker
def test_nfs_services_are_enabled(self, node, host):
assert host.service("nfs-ganesha").is_enabled
+
+ @pytest.mark.no_docker
+ def test_nfs_config_override(self, node, host):
+ assert host.file("/etc/ganesha/ganesha.conf").contains("Entries_HWMark")
copy_admin_key: true
nfs_file_gw: false
nfs_obj_gw: true
+ganesha_conf_overrides: |
+ CACHEINODE {
+ Entries_HWMark = 100000;
+ }