Fixes and improvements, NFS/KDC/LDAP related.
This commit is contained in:
parent
5d5f75e0c8
commit
fbf48f44f3
11 changed files with 134 additions and 46 deletions
|
@ -1,3 +1,12 @@
|
|||
- name: bind mount exported dir
|
||||
mount:
|
||||
path: "{{ export_root }}/home/"
|
||||
src: "{{ lan_homes }}"
|
||||
fstype: none
|
||||
state: mounted
|
||||
opts: bind
|
||||
listen: "bind mount exported dirs"
|
||||
|
||||
- name: restart nfs-kernel-server
|
||||
service: name=nfs-kernel-server state=restarted enabled=yes
|
||||
listen: "restart nfs-kernel-server"
|
||||
|
@ -9,3 +18,7 @@
|
|||
- name: restart sssd
|
||||
service: name=sssd state=restarted enabled=yes
|
||||
listen: "restart sssd"
|
||||
|
||||
- name: restart dnsmasq
|
||||
service: name=dnsmasq state=restarted enabled=yes
|
||||
listen: "restart dnsmasq"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Install and configure nfs-server
|
||||
---
|
||||
- fail: msg="The machine's domain must not be empty."
|
||||
when: ansible_domain | length == 0
|
||||
when: ansible_domain | length == 0
|
||||
|
||||
- name: check if there are installing
|
||||
stat: path=/etc/exports
|
||||
|
@ -13,19 +13,12 @@
|
|||
- nfs-kernel-server
|
||||
state: latest
|
||||
|
||||
- name: make sure the export exists
|
||||
- name: make sure the export paths exists
|
||||
file: path={{ export_root }}/home/ state=directory recurse=yes
|
||||
|
||||
- name: make sure the export exists
|
||||
- name: make sure the lan homes exists
|
||||
file: path={{ lan_homes }} state=directory recurse=yes
|
||||
|
||||
- name: bind mount exported dir
|
||||
mount:
|
||||
path: "{{ export_root }}/home/"
|
||||
src: "{{ lan_homes }}"
|
||||
fstype: none
|
||||
state: mounted
|
||||
opts: bind
|
||||
notify: "bind mount exported dirs"
|
||||
|
||||
- name: configure exports
|
||||
blockinfile:
|
||||
|
@ -36,8 +29,6 @@
|
|||
{{ export_root }}/home/ *(sec=krb5p,rw,no_subtree_check)
|
||||
notify: "restart nfs-kernel-server"
|
||||
|
||||
|
||||
|
||||
- name: check if there is a local kadmin
|
||||
stat: path=/usr/sbin/kadmin.local
|
||||
register: kadmin
|
||||
|
@ -71,4 +62,15 @@
|
|||
shell: cp -r /etc/skel {{ lan_homes }}/foo && chmod -R o-rwx {{ lan_homes }}/foo && chown -R foo:foo {{ lan_homes }}/foo
|
||||
args:
|
||||
creates: "{{ lan_homes }}/foo"
|
||||
when: foo_pwd is defined
|
||||
when: foo_pwd is defined and foo_pwd | length > 0
|
||||
|
||||
- name: check if our dnsmasq is used
|
||||
stat: path=/etc/dnsmasq.d/dnsmasq-dhcp
|
||||
register: dnsmasq
|
||||
|
||||
- name: send domain to clients
|
||||
template:
|
||||
src: dhcp-send-domain.j2
|
||||
dest: /etc/dnsmasq.d/dhcp-send-domain
|
||||
notify: "restart dnsmasq"
|
||||
when: dnsmasq.stat.exists
|
||||
|
|
2
roles/nfs-server/templates/dhcp-send-domain.j2
Normal file
2
roles/nfs-server/templates/dhcp-send-domain.j2
Normal file
|
@ -0,0 +1,2 @@
|
|||
expand-hosts
|
||||
domain={{ ansible_domain }}
|
Loading…
Add table
Add a link
Reference in a new issue