ansible/node: Handle new style /etc/nfs.conf autocluster-1.8
authorMartin Schwenke <martin@meltin.net>
Sun, 12 Jul 2020 09:02:12 +0000 (19:02 +1000)
committerMartin Schwenke <martin@meltin.net>
Thu, 13 Aug 2020 00:49:05 +0000 (10:49 +1000)
This also depends on CTDB's statd-callout to be fixed to get
NFS_HOSTNAME using nfsconf.

Signed-off-by: Martin Schwenke <martin@meltin.net>
ansible/node/roles/nas/tasks/redhat/nfs.yml
ansible/node/roles/nas/templates/nfs_common_sysconfig.j2 [new file with mode: 0644]
ansible/node/roles/nas/templates/nfs_conf.j2 [new file with mode: 0644]

index 1c111955d8e70872a6624a255a1725e0341efabc..f8eb90fc4e8b074a0bdde750e2208f286fd7921a 100644 (file)
   loop_control:
     loop_var: s
 
-- name: generate NFS configuration
+- name: check for new style /etc/nfs.conf
+  stat:
+    path: /etc/nfs.conf
+  register: etc_nfs_conf
+
+- name: generate old style NFS configuration
   template:
     src: nfs_sysconfig.j2
     dest: /etc/sysconfig/nfs
+  when: not etc_nfs_conf.stat.exists
+
+- name: generate new style NFS configuration
+  template:
+    src: nfs_conf.j2
+    dest: /etc/nfs.conf
+  when: etc_nfs_conf.stat.exists
 
 - name: check if /etc/sysconfig/rpc-rquotad exists
   stat:
diff --git a/ansible/node/roles/nas/templates/nfs_common_sysconfig.j2 b/ansible/node/roles/nas/templates/nfs_common_sysconfig.j2
new file mode 100644 (file)
index 0000000..4c115f6
--- /dev/null
@@ -0,0 +1 @@
+NFS_HOSTNAME="{{ cluster }}"
diff --git a/ansible/node/roles/nas/templates/nfs_conf.j2 b/ansible/node/roles/nas/templates/nfs_conf.j2
new file mode 100644 (file)
index 0000000..94b0bdc
--- /dev/null
@@ -0,0 +1,33 @@
+# autocluster nfs.conf
+#
+[general]
+# defaults
+
+[exportfs]
+# defaults
+
+[gssd]
+use-gss-proxy=1
+
+[lockd]
+port = 61005
+udp-port = 61005
+
+[mountd]
+port = 61003
+
+[nfsdcltrack]
+# defaults
+
+[nfsd]
+vers4 = n
+threads = 8
+
+[statd]
+name = {{ cluster }}
+port = 61001
+outgoing-port = 61002
+ha-callout = {{ ctdb_config_dir }}/statd-callout
+
+[sm-notify]
+# defaults