main.yml 631 B

123456789101112131415161718192021
  1. - name: Ensure mount point exists {{ mount_path }}
  2. file:
  3. path: "{{ mount_path }}"
  4. owner: "{{ mount_owner }}"
  5. group: "{{ mount_group }}"
  6. mode: "{{ mount_mode }}"
  7. state: directory
  8. - name: Mount {{ mount_dev }} @ {{ mount_path }}
  9. ansible.posix.mount:
  10. path: "{{ mount_path }}"
  11. src: "{{ mount_dev }}"
  12. fstype: "{{ mount_fs | default(omit) }}"
  13. opts: "{{ mount_opts | default(omit) }}"
  14. state: mounted
  15. - name: Secure mounted path {{ mount_path }}
  16. file:
  17. path: "{{ mount_path }}"
  18. owner: "{{ mount_owner }}"
  19. group: "{{ mount_group }}"
  20. mode: "{{ mount_mode }}"
  21. state: directory