You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/roles/nfs_client/tasks/main.yml

25 lines
677 B
YAML

---
# Install NFS client, mount distant storage and add configuration to fstab to make it persistent
- name: Install NFS client
apt:
name:
- nfs-common # use this on any NFS machine, be either client or server
update_cache: true
- name: Create mountable dir
file:
path: "{{ nfs.mount_path }}"
state: directory
mode: 0755
owner: "{{ nfs.dir_owner }}"
group: "{{ nfs.dir_group }}"
- name: Mount and add to fstab
mount:
state: mounted # actively mounted and configured in fstab
src: "{{ nfs.src }}"
path: "{{ nfs.mount_path }}"
fstype: nfs
opts: defaults
# don't specify dump and fsck to keep the 0 (don't) variable