- name: Create mountable dir file: path: /nfs state: directory mode: u=rwx,g=r,o=r owner: '{{ user }}' group: '{{ user }}' - name: Ensure NFS utilities are installed. apt: name: '{{ packages }}' state: present update_cache: yes vars: packages: - nfs-common - nfs-kernel-server - name: Format the data drive filesystem: fstype: ext4 dev: /dev/sdb1 - name: Mount the data drive mount: src: /dev/sdb1 path: /nfs fstype: ext4 state: mounted - name: copy /etc/exports template: src: templates/nas/etc/exports.j2 dest: /etc/exports owner: root group: root - name: restart nfs server service: name: nfs-kernel-server state: restarted