main.yml 660 B

12345678910111213141516171819202122
  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. boot: "{{ mount_boot }}"
  15. state: mounted
  16. - name: Secure mounted path {{ mount_path }}
  17. file:
  18. path: "{{ mount_path }}"
  19. owner: "{{ mount_owner }}"
  20. group: "{{ mount_group }}"
  21. mode: "{{ mount_mode }}"
  22. state: directory