Feat(Choux): Enable autofs and use it to mount nas share

This commit is contained in:
Bertrand Benjamin 2018-10-18 19:24:36 +02:00
parent 75e3f50337
commit c94e124c92
4 changed files with 35 additions and 0 deletions

View File

@ -4,6 +4,7 @@
vars_files:
- vars/common.yml
- vars/home.yml
- vars/Choux.yml
tasks:
@ -19,6 +20,7 @@
- include: tasks/dotfiles.yml
- include: tasks/wine.yml
- include: tasks/arch_virtualbox.yml
- include: tasks/home_autofs.yml
- include: tasks/choux_borg_backup.yml
handlers:

3
files/autofs.songe Normal file
View File

@ -0,0 +1,3 @@
{% for share in nas_nfs %}
{{ share.name }} {{ share.options }} {{ nas_name }}:{{ share.src }}
{% endfor %}

21
tasks/home_autofs.yml Normal file
View File

@ -0,0 +1,21 @@
---
- name: Install autofs
pacman:
name: autofs
state: present
- name: Create NAS share directory
file:
path: /media/Songe
state: directory
- name: Activate NAS shares for autofs
lineinfile:
path: /etc/autofs/auto.master
line: '/media/Songe /etc/autofs/auto.songe --timeout=60'
- name: NAS autofs config file
template:
src: files/autofs.songe
dest: /etc/autofs/auto.songe

9
vars/home.yml Normal file
View File

@ -0,0 +1,9 @@
---
nas_name: "Songe"
nas_nfs:
- src: '/export/documents',
name: 'Songe_documents',
options: '-rw,default,nls=utf8,uid=100,users'
- src: '/export/backup',
name: 'Songe_backup',
options: '-rw,default,nls=utf8,uid=100,users'