From dde73d89a725ad764509aa623c945cfa789ae2e4 Mon Sep 17 00:00:00 2001 From: binary Date: Wed, 3 Mar 2021 14:57:10 +0100 Subject: Add nfsclient role for mounting data in VM from hypervisor --- roles/nfsd/tasks/main.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'roles/nfsd/tasks') diff --git a/roles/nfsd/tasks/main.yml b/roles/nfsd/tasks/main.yml index 2f64fdb..7da9240 100644 --- a/roles/nfsd/tasks/main.yml +++ b/roles/nfsd/tasks/main.yml @@ -13,18 +13,35 @@ loop: - "{{ nfsd_dirs }}" +- name: ensure nfs shared group exists + group: + name: "{{ nfsd_group }}" + gid: "{{ nfsd_group_id }}" + system: true + state: absent + +- name: ensure nfs shared user exists + user: + name: "{{ nfsd_user }}" + uid: "{{ nfsd_user_id }}" + group: "{{ nfsd_group }}" + system: true + state: absent + - name: ensure nfsd directory exists file: path: "{{ nfsd_dir }}" - owner: root + owner: 0 + group: 0 mode: 0700 state: directory - name: ensure directories exists file: path: "{{ nfsd_dir }}/{{ item }}" - owner: root - mode: 0700 + owner: 0 + group: 0 + mode: 0777 state: directory loop: "{{ nfsd_dirs.split(' ') if nfsd_dirs is string else nfsd_dirs }}" -- cgit v1.2.3