2018-10-18 17:24:36 +00:00
|
|
|
---
|
|
|
|
- name: Install autofs
|
|
|
|
pacman:
|
|
|
|
name: autofs
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Create NAS share directory
|
|
|
|
file:
|
2019-05-12 04:47:12 +00:00
|
|
|
path: "/media/{{ item.host }}"
|
2018-10-18 17:24:36 +00:00
|
|
|
state: directory
|
2019-05-12 04:47:12 +00:00
|
|
|
with_items: "{{ autofs }}"
|
2018-10-18 17:24:36 +00:00
|
|
|
|
|
|
|
- name: Activate NAS shares for autofs
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/autofs/auto.master
|
2019-05-12 04:47:12 +00:00
|
|
|
line: "/media/{{ item.host }} /etc/autofs/auto.{{ item.host }} --timeout=60 --browse"
|
|
|
|
with_items: "{{ autofs }}"
|
2018-10-18 17:24:36 +00:00
|
|
|
|
|
|
|
- name: NAS autofs config file
|
|
|
|
template:
|
2019-05-12 04:47:12 +00:00
|
|
|
src: "files/autofs.{{ item.host }}"
|
|
|
|
dest: "/etc/autofs/auto.{{ item.host }}"
|
|
|
|
with_items: "{{ autofs }}"
|
2018-10-18 17:24:36 +00:00
|
|
|
|
2018-10-18 17:45:06 +00:00
|
|
|
- name: Enable autofs daemon
|
2018-10-18 17:42:05 +00:00
|
|
|
service:
|
2018-10-18 17:45:06 +00:00
|
|
|
name: autofs
|
2018-10-18 17:42:05 +00:00
|
|
|
state: started
|
|
|
|
enabled: yes
|