setup nfs on media server for media consumers

This commit is contained in:
Ibrahim Mkusa 2024-11-17 09:46:25 -05:00
parent af28e7a23f
commit b470d74da0
3 changed files with 30 additions and 0 deletions

View File

@ -35,6 +35,8 @@ foremanAlma ansible_user=ansible
[windows]
bane ansible_user=ansible ansible_connection=winrm ansible_winrm_transport=basic ansible_port=5985 ansible_winrm_server_cert_validation=ignore
baxter
[servers:children]
doc
aws

27
playbooks/common/nfs.yml Normal file
View File

@ -0,0 +1,27 @@
---
- name: installs nfs and makes common folders available to the network
hosts: baxter
become: true
vars_files:
- ../../vars/secrets.yml
tasks:
- name: install nfs core packages
ansible.builtin.apt:
name: nfs-kernel-server
state: present
- name: write config to /etc/exports
ansible.builtin.template:
src: ../../templates/exports.conf.j2
dest: /etc/exports
mode: '0644'
- name: export the configuration(being safe)
ansible.builtin.shell: |
exportfs -ra
- name: start the nfs service
ansible.builtin.service:
name: nfs-kernel-server
state: started
enabled: true

View File

@ -0,0 +1 @@
{{nfs_dir}} {{nfs_server_ip}}(rw,sync,no_root_squash,no_subtree_check)