--- - name: Setup access to NFS hosts: - zero - docker roles: - common become: yes gather_facts: no vars_prompt: name: nfs_server prompt: 'IP of NFS server: ' private: false tasks: - name: Install nfs-common ansible.builtin.apt: package: - nfs-common state: present - name: Create directory for mount ansible.builtin.file: path: /mnt/seagate state: directory mode: '0777' owner: root group: root - name: Add NFS server to fstab ansible.builtin.lineinfile: path: /etc/fstab line: "{{ nfs_server }}:/mnt/seagate /mnt/seagate nfs rw 0 0" register: result - name: Reboot host to apply changes ansible.builtin.reboot: msg: "Reboot initiated by Ansible" test_command: uptime when: result is changed