From 1847a5a69865f7f628f73a43f87b7f2840a1f9a2 Mon Sep 17 00:00:00 2001 From: otthorn Date: Sun, 17 Jan 2021 12:31:30 +0100 Subject: [PATCH] Add nfs-client role --- roles/nfs-client/tasks/main.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 roles/nfs-client/tasks/main.yml diff --git a/roles/nfs-client/tasks/main.yml b/roles/nfs-client/tasks/main.yml new file mode 100644 index 0000000..7137d1d --- /dev/null +++ b/roles/nfs-client/tasks/main.yml @@ -0,0 +1,24 @@ +--- +# Install NFS client, mount distant storage and add configuration to fstab to make it persistent +- name: Install NFS client + apt: + name: + - nfs-common # use this on any NFS machine, be either client or server + update_cache: true + +- name: Create mountable dir + file: + path: {{ nfs-mount-path }} + state: directory + mode: 0644 + owner: {{ nfs-dir-owner }} + group: {{ nfs-dir-group }} + +- name: Mount and add to fstab + mount: + state: mounted # actively mounted and configured in fstab + src: {{ nfs-src }} + path: {{ nfs-mount-path }} + fstype: nfs + opts: defaults +# don't specify dump and fsck to keep the 0 (don't) variable