nfs.yml 703 B

123456789101112131415161718192021
  1. ---
  2. - name: Install NFS server
  3. yum: name=nfs-utils state=present
  4. when: ansible_pkg_mgr == "yum"
  5. - name: Install NFS server
  6. dnf: name=nfs-utils state=present
  7. when: ansible_pkg_mgr == "dnf"
  8. - name: Start rpcbind
  9. service: name=rpcbind state=started enabled=yes
  10. - name: Start nfs
  11. service: name=nfs-server state=started enabled=yes
  12. - name: Export the directories
  13. lineinfile: dest=/etc/exports
  14. regexp="^{{ osnl_mount_dir }}/{{ item }} "
  15. line="{{ osnl_mount_dir }}/{{ item }} {{osnl_nfs_export_options}}"
  16. with_sequence: start={{osnl_volume_num_start}} count={{osnl_number_of_volumes}} format={{osnl_volume_prefix}}{{osnl_volume_size}}g%04d
  17. notify: restart nfs