2021-10-24 11:26:33 +00:00
|
|
|
Install NFS server packages:
|
|
|
|
pkg.installed:
|
|
|
|
- pkgs:
|
|
|
|
- nfs-kernel-server
|
|
|
|
- yast2-nfs-common
|
|
|
|
- yast2-nfs-server
|
|
|
|
|
|
|
|
Create exports structure:
|
2021-11-06 11:24:49 +00:00
|
|
|
file.directory:
|
|
|
|
- name: /srv/exports/backups
|
2021-10-24 11:26:33 +00:00
|
|
|
- user: root
|
|
|
|
- group: users
|
|
|
|
- makedirs: True
|
|
|
|
- dir_modes: "0755"
|
|
|
|
|
2021-11-06 11:24:49 +00:00
|
|
|
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
|
|
|
|
|
2021-10-24 11:26:33 +00:00
|
|
|
|
|
|
|
Start nfs-server:
|
|
|
|
service.running:
|
2021-11-06 11:24:49 +00:00
|
|
|
- name: nfs-server
|
2021-10-24 11:26:33 +00:00
|
|
|
- enable: True
|