Feat: init nfs client role
This commit is contained in:
31
roles/nfs_client/tasks/main.yml
Normal file
31
roles/nfs_client/tasks/main.yml
Normal 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 }}"
|
||||
|
||||
Reference in New Issue
Block a user