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

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