commit 9054b09cc3584c206c1219eeb8c4fe91feadd752 Author: nd Date: Sun Mar 10 22:07:36 2019 +0100 Initial commit diff --git a/defauls/main.yml b/defauls/main.yml new file mode 100644 index 0000000..ca2ad3b --- /dev/null +++ b/defauls/main.yml @@ -0,0 +1 @@ +nfs: {} diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..a8419fc --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,27 @@ +- name: install nfs client tools + package: + name: nfs-client + +- name: create mount points if they don't exist + with_dict: "{{ nfs }}" + file: + path: "{{ item.value.mountpoint }}" + state: directory + +- name: mount nfs shares + with_dict: "{{ nfs }}" + mount: + path: "{{ item.value.mountpoint }}" + src: "{{ item.value.source }}" + opts: "{{ item.value.options }}" + fstype: nfs + state: mounted + +- name: write nfs shares to fstab + with_dict: "{{ nfs }}" + mount: + path: "{{ item.value.mountpoint }}" + src: "{{ item.value.source }}" + opts: "{{ item.value.options }}" + fstype: nfs + state: present