nfs.yml 725 B

123456789101112131415161718192021222324252627282930
  1. ---
  2. - name: Install NFS server
  3. package:
  4. name: nfs-utils
  5. state: present
  6. when: not openshift_is_atomic | bool
  7. register: result
  8. until: result is succeeded
  9. - name: Start rpcbind
  10. systemd:
  11. name: rpcbind
  12. state: started
  13. enabled: yes
  14. - name: Start nfs
  15. systemd:
  16. name: nfs-server
  17. state: started
  18. enabled: yes
  19. - name: Export the directories
  20. lineinfile: dest=/etc/exports
  21. regexp="^{{ osnl_mount_dir }}/{{ item }} "
  22. line="{{ osnl_mount_dir }}/{{ item }} {{osnl_nfs_export_options}}"
  23. with_sequence:
  24. start: "{{osnl_volume_num_start}}"
  25. count: "{{osnl_number_of_volumes}}"
  26. format: "{{osnl_volume_prefix}}{{osnl_volume_size}}g%04d"
  27. notify: restart nfs