No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

encfs.yml 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. - name: Install encfs & fuse
  2. apt: pkg={{ item }} state=installed
  3. with_items:
  4. - encfs
  5. - fuse
  6. - libfuse-dev
  7. tags:
  8. - dependencies
  9. - name: Create encrypted directory
  10. file: state=directory path=/encrypted
  11. - name: Add mail user to fuse group
  12. user: name=mail append=yes groups=fuse
  13. - name: Add main user to fuse group
  14. user: name={{ main_user_name }} append=yes groups=fuse
  15. # Check if the /encrypted directory is empty
  16. - name: Check for existing encfs
  17. shell: ls /encrypted/*
  18. ignore_errors: True
  19. changed_when: False # never report as "changed"
  20. register: encfs_check
  21. # If it is empty, we need to create the encfs
  22. - name: Create encfs
  23. shell: printf "p\n{{ encfs_password }}" | encfs /encrypted /decrypted --public --stdinpass && touch /decrypted/test
  24. when: encfs_check.rc > 0
  25. # If it isn't empty, we simply need to mount it (but only if /decrypted/test doesn't exist)
  26. - name: Mount encfs
  27. shell: printf "{{ encfs_password }}" | encfs /encrypted /decrypted --public --stdinpass creates="/decrypted/test"
  28. when: encfs_check.rc == 0
  29. - name: Set decrypted directory permissions
  30. file: state=directory path=/decrypted group=mail mode=775