vn-ansible/roles/linux-autofs/tasks/main.yaml

42 lines
988 B
YAML

- name: Checking if configuration is needed
meta: end_host
when: autofs_homes_enabled is not defined or not autofs_homes_enabled
- name: Install packages for autofs
apt:
name: "{{ item }}"
state: present
with_items:
- nfs-common
- autofs
- libnfs-utils
- autofs-ldap
- name: Create homes directory
ansible.builtin.file:
path: "{{ path_mnt_homes }}"
state: directory
mode: '0755'
- name: Configure nsswitch
lineinfile:
path: /etc/nsswitch.conf
line: "automount: files"
notify: restart nslcd
- name: Add file homes.autofs configured to autofs
copy:
src: homes.autofs
dest: /etc/auto.master.d/homes.autofs
owner: root
group: root
mode: '0644'
- name: Add file /etc/auto.homes configured to the systemd
copy:
src: auto.homes
dest: /etc/auto.homes
owner: root
group: root
mode: '0644'
notify: restart autofs
- name: Service autofs service
service:
name: autofs
enabled: yes