- name: Install autofs packages apt: name: "{{ autofs_packages }}" state: present - name: Create homes directory file: path: "{{ homes_path }}" state: directory mode: '0755' - name: Configure nsswitch for autofs lineinfile: path: /etc/nsswitch.conf line: "automount: files" notify: restart-nslcd - name: Add file homes.autofs configured to autofs template: 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 template: src: auto.homes dest: /etc/auto.homes owner: root group: root mode: '0644' notify: restart-autofs - name: Service autofs service systemd: name: autofs enabled: yes