]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Ceph-nfs dynamic exports fixes 2020/head
authorJan Provaznik <jprovazn@redhat.com>
Tue, 10 Oct 2017 10:43:23 +0000 (12:43 +0200)
committerJan Provaznik <jprovazn@redhat.com>
Tue, 10 Oct 2017 11:59:01 +0000 (13:59 +0200)
* 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

group_vars/nfss.yml.sample
roles/ceph-nfs/defaults/main.yml
roles/ceph-nfs/tasks/pre_requisite_container.yml
roles/ceph-nfs/tasks/start_nfs.yml
roles/ceph-nfs/templates/ceph-nfs.service.j2
roles/ceph-nfs/templates/ganesha.conf.j2

index 1ec3961058da24cb2d0d5dc8e32d114c5f84fb12..ae20dbb0d2d6285afca3cc6f9c2871847e4e7a9b 100644 (file)
@@ -43,9 +43,7 @@ dummy:
 # NFS Ganesha Config #
 ######################
 #ceph_nfs_log_file: "/var/log/ganesha/ganesha.log"
-# whether ganesha config file should include additional
-# sub-directory with exports definitions, this is useful for dynamic exports
-#ceph_nfs_include_exports_dir: false
+#ceph_nfs_dynamic_exports: false
 
 ####################
 # FSAL Ceph Config #
index 8eb501dbb36a449a885f79ce45d9dd1a17e71050..01a92a28addf76b1c9527e02dd88f4204736cfb9 100644 (file)
@@ -35,9 +35,7 @@ nfs_obj_gw: true
 # NFS Ganesha Config #
 ######################
 ceph_nfs_log_file: "/var/log/ganesha/ganesha.log"
-# whether ganesha config file should include additional
-# sub-directory with exports definitions, this is useful for dynamic exports
-ceph_nfs_include_exports_dir: false
+ceph_nfs_dynamic_exports: false
 
 ####################
 # FSAL Ceph Config #
index 3ee0e94fbcb3d17b809a4daf91049a6d8544f892..142b9a38b941e5bfd527eeeab3e20e39a31f8868 100644 (file)
   when:
     - ansible_os_family == 'RedHat'
     - 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
index b62e47599ce569afed600d2464c2b6972ee7f00d..2829a968f03a270469c1eb891a6b4a30140f1368 100644 (file)
@@ -26,7 +26,7 @@
     owner: "root"
     group: "root"
     mode: "0755"
-  when: ceph_nfs_include_exports_dir
+  when: ceph_nfs_dynamic_exports
 
 - name: create exports dir index file
   copy:
@@ -36,7 +36,7 @@
     owner: "root"
     group: "root"
     mode: "0644"
-  when: ceph_nfs_include_exports_dir
+  when: ceph_nfs_dynamic_exports
 
 - name: generate systemd unit file
   become: true
index e3d70233991fa726e556a797a5ac5010bc5ed4c6..9f7cbcf1e18add285e5827802a4896abf9cce0f5 100644 (file)
@@ -13,6 +13,10 @@ ExecStart=/usr/bin/docker run --rm --net=host \
   -v /etc/ceph:/etc/ceph \
   -v /var/lib/nfs/ganesha:/var/lib/nfs/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 -%}
   -e KV_TYPE={{kv_type}} \
   -e KV_IP={{kv_endpoint}}\
index 1e362091e8de87bd85c27dc81763a2771ac26fb9..2a2750743e77e4cf0033daea16b47f0a28f122da 100644 (file)
@@ -1,7 +1,7 @@
 #jinja2: trim_blocks: "true", lstrip_blocks: "true"
 # {{ ansible_managed }}
 
-{% if ceph_nfs_include_exports_dir %}
+{% if ceph_nfs_dynamic_exports %}
 %include /etc/ganesha/export.d/INDEX.conf
 {% endif %}