Feat: install nfs in home_autofs

This commit is contained in:
Bertrand Benjamin 2020-01-02 07:59:40 +01:00
parent c04d20c87f
commit cdf95639e3

View File

@ -4,6 +4,20 @@
name: autofs name: autofs
state: present state: present
- name: install nfs
apt:
pkg: nfs-kernel-server
state: present
when: ansible_distribution == 'Debian'
notify: restart nfs
- name: install nfs
pacman:
pkg: nfs-utils
state: present
when: ansible_distribution != 'Debian'
notify: restart nfs
- name: Create NAS share directory - name: Create NAS share directory
file: file:
path: "/media/{{ item.host }}" path: "/media/{{ item.host }}"
@ -22,6 +36,12 @@
dest: "/etc/autofs/auto.{{ item.host }}" dest: "/etc/autofs/auto.{{ item.host }}"
with_items: "{{ autofs }}" with_items: "{{ autofs }}"
- name: Enable nfs daemon
service:
name: nfs
state: started
enabled: yes
- name: Enable autofs daemon - name: Enable autofs daemon
service: service:
name: autofs name: autofs