---
- name: Install needed packages
apt:
name:
- libpam-mount
- cifs-utils
- nfs-common
- hxtools
state: latest
- name: Configure pam_mount
blockinfile:
dest: /etc/security/pam_mount.conf.xml
block: |
rootansibleDebian-gdmsddmvirti
insertafter: ""
- name: Clean up all user processes after logout
ansible.builtin.replace:
path: /etc/security/pam_mount.conf.xml
regexp: '^()$'
replace: '#\1\n'
- name: Kill all user processes on logout
ansible.builtin.lineinfile:
path: /etc/systemd/logind.conf
line: KillUserProcesses=yes
insertafter: '#KillUserProcesses=no'
- name: Mount NFSv4 home directory
ansible.posix.mount:
src: server:/default-school
path: /srv/samba/schools/default-school
opts: sec=krb5p,_netdev,x-systemd.automount,x-systemd.idle-timeout=60
state: present
fstype: nfs4
when: nfs4