--- - name: NFS rpcmountd options lineinfile: path: /etc/default/nfs-kernel-server regexp: '^RPCMOUNTDOPTS=' line: 'RPCMOUNTDOPTS="--manage-gids --port 4047"' become: true notify: nfs_restart - name: NFS services ports lineinfile: path: /etc/services line: "{{ item }}" with_items: - mountd 4047/tcp - mountd 4047/udp - lockd 4048/tcp - lockd 4048/udp become: true notify: nfs_restart - name: NFS exports template: src: nfs_exports dest: /etc/exports owner: root group: root mode: "0644" become: true notify: nfs_reload_exports