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

12345678910111213141516171819202122232425262728293031323334
  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. - name: Check if the /encrypted directory is empty
  16. shell: ls /encrypted/*
  17. ignore_errors: True
  18. changed_when: False # never report as "changed"
  19. register: encfs_check
  20. - name: If /encrypted is empty, create the encfs there
  21. shell: printf "p\n{{ encfs_password }}" | encfs /encrypted /decrypted --public --stdinpass && touch /decrypted/test
  22. when: encfs_check.rc > 0
  23. - name: If /encrypted isn't empty, mount it (but only if /decrypted/test doesn't exist)
  24. shell: printf "{{ encfs_password }}" | encfs /encrypted /decrypted --public --stdinpass creates="/decrypted/test"
  25. when: encfs_check.rc == 0
  26. - name: Set decrypted directory permissions
  27. file: state=directory path=/decrypted group=mail mode=775