Няма описание
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.

12345678910111213141516171819202122232425262728293031323334
  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. register: encfs_check
  18. # If it is empty, we need to create the encfs
  19. - name: Create encfs
  20. shell: printf "p\n${encfs_password}" | encfs /encrypted /decrypted --public --stdinpass && touch /decrypted/test
  21. when: encfs_check.rc > 0
  22. # If it isn't empty, we simply need to mount it (but only if /decrypted/test doesn't exist)
  23. - name: Mount encfs
  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