32 lines
615 B
YAML
32 lines
615 B
YAML
|
---
|
||
|
# 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 }}"
|
||
|
|