Add NFS role

This commit is contained in:
Daniel A. Maierhofer
2018-11-03 14:56:38 +01:00
parent 0abe97831a
commit ba2046f93c
2 changed files with 23 additions and 0 deletions

3
roles/nfs/tasks/main.yml Normal file
View File

@@ -0,0 +1,3 @@
---
- import_tasks: nfs.yml
tags: [ nfs ]

20
roles/nfs/tasks/nfs.yml Normal file
View File

@@ -0,0 +1,20 @@
---
- name: nfs - install
package: name=nfs-utils
- name: nfs - create mountpoints
file: "path={{ item }} owner=root group=root mode=0755 state=directory"
with_items:
- /mnt/save/daten
- /mnt/save/fotos
failed_when: False
- name: nfs - add mountpoints
blockinfile:
path: /etc/fstab
block: |
ariane:/zv1/homes /home nfs intr,hard,rw,fsc 0 0
ariane:/zv1/daten /mnt/save/daten nfs intr,hard,rw,fsc 0 0
ariane:/zv1/fotos /mnt/save/fotos nfs intr,hard,rw,fsc 0 0
validate: "mount -a -T %s"