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

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