initial commit

This commit is contained in:
Paolo Asperti 2017-11-12 18:10:15 +01:00
parent c3be4aad34
commit 0cf97f50b5
3 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1,3 @@
---
- name: restart libnss-ldap
service: name=libnss-ldap state=restarted

View File

@ -0,0 +1,61 @@
---
- name: Installing client packages
apt:
name: '{{ item }}'
state: latest
with_items:
- nfs-common
- libnss-ldap
- 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: 0
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'
- name: ldap configuration
template:
src: 'ldap.conf'
dest: '/etc/ldap.conf'
owner: 'root'
group: 'root'
mode: 0600
notify: restart libnss-ldap

View File

@ -0,0 +1,9 @@
base dc=directory,dc=nh
uri ldap://{{ esmith.SystemName }}.{{ esmith.DomainName }}:389/
ldap_version 3
binddn cn=libuser,dc=directory,dc=nh
bindpw {{ lookup('file', '/var/lib/nethserver/secrets/libuser') }}
rootbinddn cn=libuser,dc=directory,dc=nh
pam_password md5
#ssl start_tls
nss_initgroups_ignoreusers avahi,avahi-autoipd,backup,bin,colord,daemon,dnsmasq,games,gnats,hplip,irc,kernoops,libuuid,lightdm,list,lp,mail,man,messagebus,news,proxy,pulse,root,rtkit,saned,speech-dispatcher,sshd,statd,sync,sys,syslog,usbmux,uucp,whoopsie,www-data