Feat: shares with autofs

This commit is contained in:
Bertrand Benjamin 2022-01-05 14:55:13 +01:00
parent 8c81fcd2a2
commit 640a892920
5 changed files with 26 additions and 2 deletions

View File

@ -3,3 +3,6 @@ me:
username: 'user1'
config2stow: ["nvim", "tmux", "zsh"]
autofs:
- host: nas

View File

@ -0,0 +1,2 @@
Nas_commun -rw,soft,intr,rsize=8192,wsize=8192 nas:/mnt/DocNas/Commun
Nas_perso -rw,soft,intr,rsize=8192,wsize=8192 nas:/mnt/DocNas/Benjamin

View File

@ -3,12 +3,10 @@
community.general.pacman:
name: stow
state: present
update_cache: yes
become: true
- name: Install git
community.general.pacman:
name: git
state: present
update_cache: yes
become: true

View File

@ -0,0 +1,18 @@
---
- name: Create NAS share directory
file:
path: "/media/{{ item.host }}"
state: directory
with_items: "{{ autofs }}"
- name: Activate NAS shares for autofs
lineinfile:
path: /etc/autofs/auto.master
line: "/media/{{ item.host }} /etc/autofs/auto.{{ item.host }} --timeout=60 --browse"
with_items: "{{ autofs }}"
- name: NAS autofs config file
template:
src: "files/autofs.{{ item.host }}"
dest: "/etc/autofs/auto.{{ item.host }}"
with_items: "{{ autofs }}"

View File

@ -22,6 +22,9 @@
become: true
become_user: "{{ me.username}}"
- name: home mounts
import_tasks: home_mounts.yml
- name: Gnome config
import_tasks: gnome.yml
become: true