--- - name: Install required packages apt: state: present name: - nfs-kernel-server - name: Create exports root directory file: state: directory path: "{{ global_nfs_directory }}" owner: root group: root mode: u=rwx,g=rx,o=rx - name: Configure exports root template: src: root.exports dest: "{{ exports_config }}" owner: root group: root mode: u=rw,g=r,o=r notify: - reload nfs exports - name: Create exports config directory file: state: directory path: "{{ exports_config_directory }}" owner: root group: root mode: u=rwx,g=rx,o=rx - name: Allow ports in firewall ufw: rule: allow port: "{{ global_nfs_port }}" proto: tcp