forked from LibreSchool/libreschool-nfs
initial commit
This commit is contained in:
parent
c3be4aad34
commit
0cf97f50b5
3
root/etc/ansible/roles/nfs-client/handlers/main.yml
Normal file
3
root/etc/ansible/roles/nfs-client/handlers/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- name: restart libnss-ldap
|
||||||
|
service: name=libnss-ldap state=restarted
|
61
root/etc/ansible/roles/nfs-client/tasks/main.yml
Normal file
61
root/etc/ansible/roles/nfs-client/tasks/main.yml
Normal 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
|
9
root/etc/ansible/roles/nfs-client/templates/ldap.conf
Normal file
9
root/etc/ansible/roles/nfs-client/templates/ldap.conf
Normal 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
|
Loading…
x
Reference in New Issue
Block a user