Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to allow NFS to lookup GIDs. #512

Merged
merged 1 commit into from
Dec 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions roles/nfs_server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,33 @@
#
---
- name: 'Install NFS utils.'
yum:
ansible.builtin.yum:
name: nfs-utils
notify:
- restart_nfs-server
- export_nfs_shares
become: true

#
# The NFS protocol is limited to sending the UID and the first 16 GIDs of the user,
# who wants to access a file/folder. Must add --manage-gids option to rpc.mountd
# to allow the NFS server to do GID lookups using LDAP or other identity sources
# and overcome the infamous NFS 16 group limit.
#
- name: 'Patch /etc/sysconfig/nfs to add --manage-gids option to rpc.mountd.'
ansible.builtin.lineinfile:
dest: /etc/sysconfig/nfs
regexp: '^#?RPCMOUNTDOPTS='
line: 'RPCMOUNTDOPTS="--manage-gids"'
owner: root
group: root
mode: '0644'
notify:
- restart_nfs-server
become: true

- name: 'Enable and start nfs-server service.'
systemd:
ansible.builtin.systemd:
name: nfs-server.service
state: 'started'
enabled: true
Expand All @@ -21,7 +39,7 @@
become: true

- name: 'Add NFS share to /etc/exports.'
lineinfile:
ansible.builtin.lineinfile:
path: /etc/exports
line: "/mnt/{{ item.pfs }} {{ network_private_storage_cidr }}(rw,sync,no_root_squash,no_subtree_check)"
with_items: "{{ pfs_mounts | selectattr('type', 'search', 'nfs') | selectattr('device', 'defined') | list }}"
Expand Down