Ceph-nfs dynamic exports fixes

* DBus on host should include ganesha service file
* to allow ganesha container to respond on DBus it needs to run
  in --privileged mode (ganesha folks contacted to look at this)
* ceph_nfs_include_exports_dir variable replaced with more general
  ceph_nfs_dynamic_exports
pull/2020/head
Jan Provaznik 2017-10-10 12:43:23 +02:00
parent a10f12954d
commit 87b1da09e7
6 changed files with 25 additions and 9 deletions

View File

@ -43,9 +43,7 @@ dummy:
# NFS Ganesha Config # # NFS Ganesha Config #
###################### ######################
#ceph_nfs_log_file: "/var/log/ganesha/ganesha.log" #ceph_nfs_log_file: "/var/log/ganesha/ganesha.log"
# whether ganesha config file should include additional #ceph_nfs_dynamic_exports: false
# sub-directory with exports definitions, this is useful for dynamic exports
#ceph_nfs_include_exports_dir: false
#################### ####################
# FSAL Ceph Config # # FSAL Ceph Config #

View File

@ -35,9 +35,7 @@ nfs_obj_gw: true
# NFS Ganesha Config # # NFS Ganesha Config #
###################### ######################
ceph_nfs_log_file: "/var/log/ganesha/ganesha.log" ceph_nfs_log_file: "/var/log/ganesha/ganesha.log"
# whether ganesha config file should include additional ceph_nfs_dynamic_exports: false
# sub-directory with exports definitions, this is useful for dynamic exports
ceph_nfs_include_exports_dir: false
#################### ####################
# FSAL Ceph Config # # FSAL Ceph Config #

View File

@ -37,3 +37,19 @@
when: when:
- ansible_os_family == 'RedHat' - ansible_os_family == 'RedHat'
- sestatus.stdout != 'Disabled' - sestatus.stdout != 'Disabled'
- name: create dbus service file
become: true
template:
src: "{{ role_path }}/templates/org.ganesha.nfsd.conf"
dest: /etc/dbus-1/system.d/org.ganesha.nfsd.conf
owner: "root"
group: "root"
mode: "0644"
when:
- ceph_nfs_dynamic_exports
- name: reload dbus configuration
command: "killall -SIGHUP dbus-daemon"
when:
- ceph_nfs_dynamic_exports

View File

@ -26,7 +26,7 @@
owner: "root" owner: "root"
group: "root" group: "root"
mode: "0755" mode: "0755"
when: ceph_nfs_include_exports_dir when: ceph_nfs_dynamic_exports
- name: create exports dir index file - name: create exports dir index file
copy: copy:
@ -36,7 +36,7 @@
owner: "root" owner: "root"
group: "root" group: "root"
mode: "0644" mode: "0644"
when: ceph_nfs_include_exports_dir when: ceph_nfs_dynamic_exports
- name: generate systemd unit file - name: generate systemd unit file
become: true become: true

View File

@ -13,6 +13,10 @@ ExecStart=/usr/bin/docker run --rm --net=host \
-v /etc/ceph:/etc/ceph \ -v /etc/ceph:/etc/ceph \
-v /var/lib/nfs/ganesha:/var/lib/nfs/ganesha \ -v /var/lib/nfs/ganesha:/var/lib/nfs/ganesha \
-v /etc/ganesha:/etc/ganesha \ -v /etc/ganesha:/etc/ganesha \
{% if ceph_nfs_dynamic_exports %}
--privileged \
-v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket \
{% endif -%}
{% else -%} {% else -%}
-e KV_TYPE={{kv_type}} \ -e KV_TYPE={{kv_type}} \
-e KV_IP={{kv_endpoint}}\ -e KV_IP={{kv_endpoint}}\

View File

@ -1,7 +1,7 @@
#jinja2: trim_blocks: "true", lstrip_blocks: "true" #jinja2: trim_blocks: "true", lstrip_blocks: "true"
# {{ ansible_managed }} # {{ ansible_managed }}
{% if ceph_nfs_include_exports_dir %} {% if ceph_nfs_dynamic_exports %}
%include /etc/ganesha/export.d/INDEX.conf %include /etc/ganesha/export.d/INDEX.conf
{% endif %} {% endif %}