libreschool-nfs/root/etc/ansible/roles/nfs-client/tasks/main.yml

89 lines
2.1 KiB
YAML

---
- name: Installing client packages
apt:
name: [ 'nfs-common', 'libnss-ldap' ]
state: latest
- name: Create directory for user homes
file: path=/var/lib/nethserver/home state=directory owner=root group=root mode=0755
- name: Add mount to fstab
mount:
path: /var/lib/nethserver/home
src: "{{ esmith.SystemName }}.{{ esmith.DomainName }}:/var/lib/nethserver/home"
fstype: nfs4
opts: rw,async,_netdev
passno: 1
dump: 0
state: mounted
# forse questo non serve
- name: Tweak idmap.conf
ini_file:
path: /etc/idmapd.conf
section: Translation
option: Method
value: nsswitch
mode: 0644
- name: nsswitch settings for passwd
lineinfile:
path: /etc/nsswitch.conf
state: present
regexp: '^passwd\:'
line: 'passwd: files ldap'
- name: nsswitch settings for group
lineinfile:
path: /etc/nsswitch.conf
state: present
regexp: '^group\:'
line: 'group: files ldap'
- name: nsswitch settings for shadow
lineinfile:
path: /etc/nsswitch.conf
state: present
regexp: '^shadow\:'
line: 'shadow: files ldap'
# TODO: think about security... we should move the ldap admin password somewhere else
- name: ldap configuration
template:
src: 'ldap.conf'
dest: '/etc/ldap.conf'
owner: 'root'
group: 'root'
mode: 0644
- name: Check if lightdm is installed
shell: dpkg-query -W -f='${Status}' lightdm | grep 'install ok installed'
register: lightdm_installed
failed_when: no
changed_when: no
- name: Check if gdm3 is installed
shell: dpkg-query -W -f='${Status}' gdm3 | grep 'install ok installed'
register: gdm3_installed
failed_when: no
changed_when: no
- name: Adjusting lightdm settings
template:
src: 'lightdm.conf'
dest: '/usr/share/lightdm/lightdm.conf.d/50-libreschool.conf'
owner: 'root'
group: 'root'
mode: 0644
when: lightdm_installed.rc == 0
- name: Adjust gdm3 settings
ini_file:
path: /etc/gdm3/greeter.dconf-defaults
section: org/gnome/login-screen
option: disable-user-list
value: "true"
no_extra_spaces: yes
when: gdm3_installed.rc == 0