Commit 17067eb8 authored by Lars Beckers's avatar Lars Beckers

nfs-client: reworked role for kerberized nfs v4

parent 4afd54d5
#!/bin/bash
if [ ! -h /$1 ]; then
rm /$1
rmdir /$1
ln -s /net/$1 /$1
fi
options nfs nfs4_disable_idmapping=N
......@@ -7,8 +7,5 @@
- name: restart nfs-common
service: name=nfs-common state=restarted
- name: reload sysfs.conf
service: name=sysfsutils state=restarted
- name: reload sysctl
command: sysctl -p
......@@ -2,42 +2,30 @@
# file: roles/nfs-client/tasks/main.yml
- name: ensure nfs client utils are installed
apt: name=nfs-common state=latest
tags:
- nfs-client
- packages
- name: ensure CIFS utils are installed
apt: name=cifs-utils,smbclient state=latest
tags:
- nfs-client
- cifs-client
- packages
- name: ensure sysfs-utils are installed
apt: name=sysfsutils state=present
apt: name="{{ item }}" state=installed
with_items:
- nfs-common
- libgssrpc4
- librpcsecgss3
- autofs
tags:
- nfs-client
- packages
- name: ensure we use the idmapper
command: 'echo "N" > /sys/module/nfs/parameters/nfs4_disable_idmapping'
notify:
- restart nfs-common
tags:
- nfs-client
- sysfs
- config
- name: ensure we use the idmapper after a reboot
lineinfile: line="module/nfs/parameters/nfs4_disable_idmapping = N" dest=/etc/sysfs.conf create=yes
notify:
- reload sysfs.conf
- restart nfs-common
tags:
- nfs-client
- sysfs
- config
#- name: ensure we use the idmapper
# copy: content="N" dest=/sys/module/nfs/parameters/nfs4_disable_idmapping
# notify:
# - restart nfs-common
# - restart autofs
# tags:
# - nfs-client
# - config
#
#- name: ensure we use the idmapper after a reboot
# copy: src=modprobe-nfs.conf dest=/etc/modprobe.d/nfs.conf owner=root group=root mode=0644
# tags:
# - nfs-client
# - config
- name: ensure the kernel key storage quote used for idmapping is sufficiently high
sysctl: name=kernel.keys.root_maxkeys state=present value=1000 # default is 200, this quote was reached
......@@ -59,13 +47,12 @@
- sysctl
- config
# makes life much easier to have an automounter and not /etc/fstab
- name: ensure automounter is installed
apt: name=autofs state=latest
- name: ensure there is a base directory for automount
file: state=directory path=/net owner=root group=root mode=0755
notify:
- restart autofs
tags:
- nfs-client
- autofs
- packages
- name: ensure automounter is configured
copy: src=auto.master dest=/etc/auto.master owner=root group=root mode=0644
......@@ -73,39 +60,33 @@
- restart autofs
tags:
- nfs-client
- autofs
- config
- name: ensure mounts from central storage are available
template: src=auto.nfs.j2 dest=/etc/auto.nfs owner=root group=root mode=0644
notify:
- nfs-client
- restart autofs
tags:
- autofs
- nfs-client
- config
- name: ensure automounter is enabled
service: name=autofs state=running enabled=yes
tags:
- nfs-client
- autofs
- service
- name: ensure linking of home
script: create_netdir.sh home
- name: ensure linking of netdirs
file: src="/net/{{ item.netdir }}" dest="/{{ item.dest }}" state=link force=yes
with_items: "{{ nfs_shares }}"
tags:
- nfs-client
- fsmpi
- autofs
- name: ensure linking of pub
script: create_netdir.sh pub
- name: configure default umask and other user related stuff
copy: src=login.defs dest=/etc/login.defs owner=root group=root mode=0644
tags:
- nfs-client
- fsmpi
- autofs
- umask
- config
- meta: flush_handlers
- include: umask.yml
- meta: flush_handlers
---
# file: roles/client/tasks/main.yml
- name: configure default umask and other user related stuff
copy: src=login.defs dest=/etc/login.defs owner=root group=root mode=0644
tags:
- umask
- config
- name: activate pam.d session modules to set default umask
lineinfile: dest=/etc/pam.d/common-session line="session optional pam_umask.so"
tags:
- umask
- pam
- config
{% for share in nfsshares %}
{{ share }}
{% endfor %}
{%- for share in nfs_shares %}
{{ share.netdir }} -{{ share.options }} {{ share.src }}
{% endfor -%}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment