Add mountnfs role

This commit is contained in:
Javier Feliz 2025-07-07 19:29:10 -04:00
parent b0313a99fc
commit 6aa11f0d10
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,3 @@
mount_host: "{{ hostvars['nas'].ansible_host }}"
share: "/mnt/main/media"
mount_path: "/mnt/unspecifiedshare"

View File

@ -0,0 +1,21 @@
---
- name: Ensure NFS client is installed
ansible.builtin.package:
name: nfs-common
state: present
become: true
- name: Create mount point directory
ansible.builtin.file:
path: "{{ mount_path }}"
state: directory
mode: '0777'
become: true
- name: Mount share
ansible.posix.mount:
src: "{{ mount_host }}:{{ share }}"
path: "{{ mount_path }}"
fstype: nfs
state: mounted
become: true