diff --git a/salt/states/nfs-server/init.sls b/salt/states/nfs-server/init.sls index a84ff0b..d04f5ef 100644 --- a/salt/states/nfs-server/init.sls +++ b/salt/states/nfs-server/init.sls @@ -6,18 +6,22 @@ Install NFS server packages: - yast2-nfs-server Create exports structure: - file.recurse: - - name: /srv/exports - - source: salt://nfs-server/files/exports + file.directory: + - name: /srv/exports/backups - user: root - group: users - - file_mode: "0600" - - include_empty: True - makedirs: True - dir_modes: "0755" +Add backups exports: + file.replace: + - name: /etc/exports + - pattern: "/srv/exports/backups {{ pillar['network']['ip'] }}/24(rw,no_root_squash,sync,no_subtree_check)" + - repl: "/srv/exports/backups {{ pillar['network']['ip'] }}/24(rw,no_root_squash,sync,no_subtree_check)" + - append_if_not_found: True + Start nfs-server: service.running: - - name: nfsserver + - name: nfs-server - enable: True