From 231976d1dc0af2d460bb763d77b55b297c3ef047 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 25 Sep 2016 13:50:53 +0200 Subject: [PATCH] Make fileserver setup deterministic Create the home directories before trying to bind mount them to /srv/nfs4 subdirectories. Remove unneeded acl parameter that lead to rewrites of /etc/fstab for every salt run. --- states/fileserver/init.sls | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/states/fileserver/init.sls b/states/fileserver/init.sls index 3728d3d..fe7a687 100644 --- a/states/fileserver/init.sls +++ b/states/fileserver/init.sls @@ -7,6 +7,15 @@ base-dirs: - group: root - mode: 0755 +home-dirs: + file.directory: + - names: + - /home/mail + - /home/www + - user: root + - group: root + - mode: 0751 + nfs4-dirs: file.directory: - names: @@ -15,6 +24,8 @@ nfs4-dirs: - user: root - group: root - mode: 0751 + - require: + - file: /srv/nfs4 /srv/nfs4/web: mount.mounted: @@ -22,10 +33,10 @@ nfs4-dirs: - fstype: none - opts: - bind - - acl - persist: True - require: - file: nfs4-dirs + - file: /home/www /srv/nfs4/mail: mount.mounted: @@ -33,10 +44,10 @@ nfs4-dirs: - fstype: none - opts: - bind - - acl - persist: True - require: - file: nfs4-dirs + - file: /home/mail /srv/sftp/home: file.directory: @@ -48,10 +59,10 @@ nfs4-dirs: - fstype: none - opts: - bind - - acl - persist: True - require: - file: /srv/sftp/home + - file: /home/mail fileserver-packages: pkg.installed: