forked from LibreSchool/server-config
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
e882d1128d |
@ -7,3 +7,4 @@ dependencies:
|
|||||||
- { role: doraemon, tags: [ 'client-install' ] }
|
- { role: doraemon, tags: [ 'client-install' ] }
|
||||||
- { role: npm, tags: [ 'client-install' ] }
|
- { role: npm, tags: [ 'client-install' ] }
|
||||||
- { role: git-daemon, tags: [ 'client-install' ] }
|
- { role: git-daemon, tags: [ 'client-install' ] }
|
||||||
|
- { role: nfs-server, tags: [ 'client-install' ] }
|
||||||
|
9
roles/nfs-server/files/access.ldif
Normal file
9
roles/nfs-server/files/access.ldif
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
dn: olcDatabase={2}bdb,cn=config
|
||||||
|
changetype: modify
|
||||||
|
replace: olcAccess
|
||||||
|
olcAccess: {0}to attrs=sambaNTPassword by dn.exact="gidNumber=0+uidNumber=0,cn
|
||||||
|
=peercred,cn=external,cn=auth" manage by dn.exact="cn=samba,dc=directory,dc=n
|
||||||
|
h" peername.ip="127.0.0.1" write by self write by * none
|
||||||
|
olcAccess:: ezF9dG8gYXR0cnM9dXNlclBhc3N3b3JkIA0KIGJ5IGRuLmV4YWN0PSJnaWROdW1iZXI9MCt1aWROdW1iZXI9MCxjbj1wZWVyY3JlZCxjbj1leHRlcm5hbCxjbj1hdXRoIiBtYW5hZ2UNCiBieSBkbi5leGFjdD0iY249cGFtLGRjPWRpcmVjdG9yeSxkYz1uaCIgcGVlcm5hbWUucGF0aD0iL3Zhci9ydW4vbGRhcGkiIHdyaXRlIA0KIGJ5IGRuLmV4YWN0PSJjbj1saWJ1c2VyLGRjPWRpcmVjdG9yeSxkYz1uaCIgcGVlcm5hbWUuaXA9IjEyNy4wLjAuMSIgd3JpdGUNCiBieSBhbm9ueW1vdXMgYXV0aCANCiBieSBzZWxmIHdyaXRlIA0KIGJ5ICogbm9uZQ==
|
||||||
|
olcAccess:: ezJ9dG8gZG4uYmFzZT0iIg0KIGJ5ICogcmVhZA==
|
||||||
|
olcAccess:: ezN9dG8gKg0KIGJ5IHNlbGYgd3JpdGUNCiBieSBkbi5leGFjdD0iZ2lkTnVtYmVyPTArdWlkTnVtYmVyPTAsY249cGVlcmNyZWQsY249ZXh0ZXJuYWwsY249YXV0aCIgbWFuYWdlDQogYnkgZG4uZXhhY3Q9ImNuPXNhbWJhLGRjPWRpcmVjdG9yeSxkYz1uaCIgcGVlcm5hbWUuaXA9IjEyNy4wLjAuMSIgd3JpdGUgDQogYnkgZG4uZXhhY3Q9ImNuPXBhbSxkYz1kaXJlY3RvcnksZGM9bmgiIHBlZXJuYW1lLnBhdGg9Ii92YXIvcnVuL2xkYXBpIiB3cml0ZSANCiBieSBkbi5leGFjdD0iY249bGlidXNlcixkYz1kaXJlY3RvcnksZGM9bmgiIHBlZXJuYW1lLmlwPSIxMjcuMC4wLjEiIHdyaXRlIA0KIGJ5IHVzZXJzIHNzZj03MSByZWFkIA0KIGJ5ICogcmVhZA==
|
1
roles/nfs-server/files/nfsd.conf
Normal file
1
roles/nfs-server/files/nfsd.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
options nfsd nfs4_disable_idmapping=1
|
3
roles/nfs-server/tasks/main.yml
Normal file
3
roles/nfs-server/tasks/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- include: nfs-server.yml
|
||||||
|
tags: nfs-server
|
54
roles/nfs-server/tasks/nfs-server.yml
Normal file
54
roles/nfs-server/tasks/nfs-server.yml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
# Install and configure nfs server
|
||||||
|
|
||||||
|
- name: Installing nfs-utils
|
||||||
|
yum: pkg=nfs-utils state=present
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: Activating NFS at boot
|
||||||
|
shell: /sbin/chkconfig nfs on
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: Configuring exports
|
||||||
|
template: src='preseed/exports' dest='/etc/exports'
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: Copy LDIF access file
|
||||||
|
copy: src=files/access.ldif dest=/tmp/access.ldif
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: Enable LDAP external access
|
||||||
|
shell: /usr/bin/ldapmodify -Y EXTERNAL -f /tmp/access.ldif
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: Remove LDIF access file
|
||||||
|
shell: /bin/rm /tmp/access.ldif
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
## TODO: (maybe) add port 111? (rpcbind)
|
||||||
|
- name: Configuring firewall service for NFS
|
||||||
|
shell: /sbin/e-smith/db configuration set nfs service TCPPort 2049 UDPPort 2049 status enabled access private
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: Reloading firewall configuration
|
||||||
|
shell: /sbin/e-smith/signal-event firewall-adjust
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: Reloading runlevel configuration
|
||||||
|
shell: /sbin/e-smith/signal-event runlevel-adjust
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: Disable NFS4 id mapping at boot
|
||||||
|
copy: src=files/nfsd.conf dest=/etc/modules.d/nfsd.conf
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: Disable NFS4 id mapping
|
||||||
|
shell: /bin/echo Y > /sys/module/nfsd/parameters/nfs4_disable_idmapping
|
||||||
|
|
||||||
|
- name: Reloading NFS exports
|
||||||
|
shell: /usr/sbin/exportfs -ra
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
- name: Restarting NFS server
|
||||||
|
shell: /sbin/service nfs restart
|
||||||
|
become: yes
|
1
roles/nfs-server/templates/exports
Normal file
1
roles/nfs-server/templates/exports
Normal file
@ -0,0 +1 @@
|
|||||||
|
/var/lib/nethserver/home {{ ansible_local.domain.servernet }}/{{ ansible_local.domain.servernetmask }}(rw,no_root_squash,sync,no_subtree_check)
|
Loading…
x
Reference in New Issue
Block a user