Ansible_workstation/tasks/home_autofs.yml

30 lines
663 B
YAML
Raw Normal View History

---
- 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 }}"
state: directory
2019-05-12 04:47:12 +00:00
with_items: "{{ autofs }}"
- 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 }}"
- 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 }}"
- name: Enable autofs daemon
2018-10-18 17:42:05 +00:00
service:
name: autofs
2018-10-18 17:42:05 +00:00
state: started
enabled: yes