Fix NFS for FreeBSD workstations.
This commit is contained in:
		@@ -75,5 +75,6 @@
 | 
				
			|||||||
    firefox_esr: firefox-esr
 | 
					    firefox_esr: firefox-esr
 | 
				
			||||||
    psutil: py38-psutil
 | 
					    psutil: py38-psutil
 | 
				
			||||||
    ansible_python_interpreter: "/usr/local/bin/python3.8"
 | 
					    ansible_python_interpreter: "/usr/local/bin/python3.8"
 | 
				
			||||||
 | 
					    nfs: htop
 | 
				
			||||||
  when: ansible_system == "FreeBSD"
 | 
					  when: ansible_system == "FreeBSD"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,15 +1,45 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
# Use Apt specific because they're consistent! :)
 | 
					# Mount network shares.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Workstation | Settings | NFS | Facts
 | 
					- name: Workstation | Settings | NFS | Facts
 | 
				
			||||||
  set_fact:
 | 
					  set_fact:
 | 
				
			||||||
    media_folder: /mnt/media
 | 
					    media_folder: /mnt/media
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Workstation | Settings | NFS | Install
 | 
					- name: Workstation | Settings | NFS | Facts (Linux)
 | 
				
			||||||
 | 
					  set_fact:
 | 
				
			||||||
 | 
					    mount_number: 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Workstation | Settings | NFS | Facts (FreeBSD)
 | 
				
			||||||
 | 
					  set_fact:
 | 
				
			||||||
 | 
					    mount_number: 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Workstation | Settings | NFS | Install (Linux)
 | 
				
			||||||
  package: 
 | 
					  package: 
 | 
				
			||||||
    name: 
 | 
					    name: 
 | 
				
			||||||
      - "{{ nfs }}"
 | 
					      - "{{ nfs }}"
 | 
				
			||||||
    state: present
 | 
					    state: present
 | 
				
			||||||
 | 
					  when: ansible_system == "Linux"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# https://www.unixmen.com/setup-nfs-server-on-freebsd/
 | 
				
			||||||
 | 
					- name: Workstation | Settings | NFS | Install (FreeBSD)
 | 
				
			||||||
 | 
					  blockinfile:
 | 
				
			||||||
 | 
					    path: "{{ rc_conf }}"
 | 
				
			||||||
 | 
					    marker: "# {mark} MANAGED BY ANSIBLE | NFS Components"
 | 
				
			||||||
 | 
					    block: |
 | 
				
			||||||
 | 
					      nfs_server_enable="YES"
 | 
				
			||||||
 | 
					      nfs_server_flags="-u -t -n 4"
 | 
				
			||||||
 | 
					      rpcbind_enable="YES"
 | 
				
			||||||
 | 
					      mountd_flags="-r"
 | 
				
			||||||
 | 
					      mountd_enable="YES"
 | 
				
			||||||
 | 
					      nfs_client_enable="YES"
 | 
				
			||||||
 | 
					      nfs_client_flags="-n 4"
 | 
				
			||||||
 | 
					      rpc_lockd_enable="YES"
 | 
				
			||||||
 | 
					      rpc_statd_enable="YES"
 | 
				
			||||||
 | 
					    create: yes
 | 
				
			||||||
 | 
					    backup: yes
 | 
				
			||||||
 | 
					  when: ansible_system == "FreeBSD"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Workstation | Settings | NFS | Create Folders
 | 
					- name: Workstation | Settings | NFS | Create Folders
 | 
				
			||||||
  file: 
 | 
					  file: 
 | 
				
			||||||
@@ -19,10 +49,11 @@
 | 
				
			|||||||
  loop:
 | 
					  loop:
 | 
				
			||||||
    - "{{ media_folder }}"
 | 
					    - "{{ media_folder }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Workstation | Settings | NFS | Create Mount Instructions
 | 
					- name: Workstation | Settings | NFS | Create Mount Instructions
 | 
				
			||||||
  blockinfile:
 | 
					  blockinfile:
 | 
				
			||||||
    path: /etc/fstab
 | 
					    path: /etc/fstab
 | 
				
			||||||
    marker: "# {mark} MANAGED BY ANSIBLE | Media"
 | 
					    marker: "# {mark} MANAGED BY ANSIBLE | Media"
 | 
				
			||||||
    block: |
 | 
					    block: |
 | 
				
			||||||
      htpc:/mnt/hdd_unsafe/media {{ media_folder }} nfs defaults 0 0
 | 
					      htpc:/mnt/hdd_unsafe/media {{ media_folder }} nfs defaults {{ mount_number }} {{ mount_number }}
 | 
				
			||||||
    backup: yes
 | 
					    backup: yes
 | 
				
			||||||
		Reference in New Issue
	
	Block a user