Ansible_workstation/roles/workstation/tasks/home_mounts.yml

31 lines
699 B
YAML
Raw Permalink Normal View History

2022-01-10 04:26:00 +00:00
---
- name: Create auto host share directory
2022-01-10 04:26:00 +00:00
file:
path: "/media/{{ item.host }}"
state: directory
with_items: "{{ autofs }}"
- name: Activate host shares for autofs
2022-01-10 04:26:00 +00:00
lineinfile:
path: /etc/autofs/auto.master
line: "/media/{{ item.host }} /etc/autofs/auto.{{ item.host }} --timeout=60 --browse"
with_items: "{{ autofs }}"
- name: autofs config file
2022-01-10 04:26:00 +00:00
template:
src: "files/autofs.{{ item.host }}"
dest: "/etc/autofs/auto.{{ item.host }}"
with_items: "{{ autofs }}"
- name: enable service nfs
systemd:
name: nfs-client.target
enabled: yes
state: started
- name: Enable autofs daemon
service:
name: autofs
state: started
enabled: yes