nfs-ganesha: add config overrides section

Signed-off-by: Ali Maredia <amaredia@redhat.com>
pull/1780/head
Ali Maredia 2017-09-03 11:32:44 -04:00
parent c907ec41ae
commit f3e2235b3a
7 changed files with 75 additions and 6 deletions

View File

@ -60,6 +60,28 @@ dummy:
#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY" #ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C" #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 # # DOCKER #
########## ##########

View File

@ -11,7 +11,7 @@ fetch_directory: fetch/
# at their disposal, some people might want to have it # at their disposal, some people might want to have it
# distributed on RGW nodes. Setting 'copy_admin_key' to 'true' # distributed on RGW nodes. Setting 'copy_admin_key' to 'true'
# will copy the admin key to the /etc/ceph/ directory # will copy the admin key to the /etc/ceph/ directory
copy_admin_key: yes copy_admin_key: false
####################### #######################
# Access type options # # Access type options #
@ -52,6 +52,27 @@ ceph_nfs_rgw_user: "cephnfs"
#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY" #ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C" #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 # # DOCKER #

View File

@ -35,12 +35,17 @@
- name: generate ganesha configuration file - name: generate ganesha configuration file
action: config_template action: config_template
args: 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 dest: /etc/ganesha/ganesha.conf
owner: "root" owner: "root"
group: "root" group: "root"
mode: "0644" mode: "0644"
config_type: ini 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 - name: start nfs gateway service
service: service:

View File

@ -12,15 +12,17 @@ EXPORT
Access_Type = {{ ceph_nfs_ceph_access_type }}; Access_Type = {{ ceph_nfs_ceph_access_type }};
NFS_Protocols = {{ ceph_nfs_ceph_protocols }}; Protocols = {{ ceph_nfs_ceph_protocols }};
Transport_Protocols = TCP; Transports = TCP;
Sectype = sys,krb5,krb5i,krb5p; Sectype = sys,krb5,krb5i,krb5p;
FSAL { FSAL {
Name = CEPH; Name = CEPH;
} }
{{ ganesha_ceph_export_overrides | default(None) }}
} }
{% endif %} {% endif %}
{% if nfs_obj_gw %} {% if nfs_obj_gw %}
@ -34,9 +36,9 @@ EXPORT
Access_Type = {{ ceph_nfs_rgw_access_type }}; Access_Type = {{ ceph_nfs_rgw_access_type }};
NFS_Protocols = {{ ceph_nfs_rgw_protocols }}; Protocols = {{ ceph_nfs_rgw_protocols }};
Transport_Protocols = TCP; Transports = TCP;
Sectype = sys,krb5,krb5i,krb5p; Sectype = sys,krb5,krb5i,krb5p;
@ -46,6 +48,9 @@ EXPORT
Access_Key_Id ="{{ ceph_nfs_rgw_access_key }}"; Access_Key_Id ="{{ ceph_nfs_rgw_access_key }}";
Secret_Access_Key = "{{ ceph_nfs_rgw_secret_key }}"; Secret_Access_Key = "{{ ceph_nfs_rgw_secret_key }}";
} }
{{ ganesha_rgw_export_overrides | default(None) }}
} }
{% endif %} {% endif %}
@ -55,4 +60,8 @@ LOG {
destination = "{{ ceph_nfs_log_file }}"; destination = "{{ ceph_nfs_log_file }}";
enable = active; enable = active;
} }
{{ ganesha_log_overrides | default(None) }}
} }
{{ ganesha_conf_overrides | default(None) }}

View File

@ -1,3 +1,7 @@
copy_admin_key: true copy_admin_key: true
nfs_file_gw: false nfs_file_gw: false
nfs_obj_gw: true nfs_obj_gw: true
ganesha_conf_overrides: |
CACHEINODE {
Entries_HWMark = 100000;
}

View File

@ -17,3 +17,7 @@ class TestNFSs(object):
@pytest.mark.no_docker @pytest.mark.no_docker
def test_nfs_services_are_enabled(self, node, host): def test_nfs_services_are_enabled(self, node, host):
assert host.service("nfs-ganesha").is_enabled 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")

View File

@ -1,3 +1,7 @@
copy_admin_key: true copy_admin_key: true
nfs_file_gw: false nfs_file_gw: false
nfs_obj_gw: true nfs_obj_gw: true
ganesha_conf_overrides: |
CACHEINODE {
Entries_HWMark = 100000;
}