nfs.yml 662 B

123456789101112131415161718192021
  1. ---
  2. - name: Install NFS server on Fedora/Red Hat
  3. yum: name=nfs-utils state=present
  4. when: ansible_pkg_mgr == "yum"
  5. - name: Install NFS server on Fedora/Red Hat
  6. dnf: name=nfs-utils state=present
  7. when: ansible_pkg_mgr == "dnf"
  8. - name: Start rpcbind on Fedora/Red Hat
  9. service: name=rpcbind state=started enabled=yes
  10. - name: Start nfs on Fedora/Red Hat
  11. service: name=nfs-server state=started enabled=yes
  12. - name: Export the directories
  13. lineinfile: dest=/etc/exports
  14. regexp="^{{ mount_dir }}/{{ item.name }} "
  15. line="{{ mount_dir }}/{{ item.name }} {{nfs_export_options}}"
  16. with_items: partition_pool
  17. notify: restart nfs