Feat: init nfs client role

This commit is contained in:
2022-03-09 14:17:07 +01:00
parent 19658ae596
commit a4688b6f99
12 changed files with 182 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
---
# tasks file for nfs_client
- name: Install nfs-common
apt:
name: "{{ item }}"
state: present
with_items:
- nfs-common
- name: Ensure rpcbind is running (Debian)
systemd:
name: rpcbind
state: started
enabled: yes
- name: Ensure nfs mount points exist
file:
path: "{{ item.mount_point }}"
state: directory
with_items: "{{ nfs_shares }}"
- name: Add nfs shares to fstab
mount:
src: "{{ item.server }}:{{ item.export }}"
path: "{{ item.mount_point }}"
opts: "{{ item.options }}"
state: mounted
fstype: nfs
with_items: "{{ nfs_shares }}"