Browse Source

Merge pull request #356 from neuhaus/encfs_optional

Create main user without "fuse" group, instead add it later
Alex Payne 9 years ago
parent
commit
95563f20b3
3 changed files with 10 additions and 4 deletions
  1. 3
    3
      roles/common/tasks/encfs.yml
  2. 6
    0
      roles/common/tasks/main.yml
  3. 1
    1
      roles/common/tasks/users.yml

+ 3
- 3
roles/common/tasks/encfs.yml View File

@@ -8,12 +8,12 @@
8 8
 - name: Create encrypted directory
9 9
   file: state=directory path=/encrypted
10 10
 
11
-- name: Create decrypted directory
12
-  file: state=directory path=/decrypted
13
-
14 11
 - name: Add mail user to fuse group
15 12
   user: name=mail append=yes groups=fuse
16 13
 
14
+- name: Add main user to fuse group
15
+  user: name={{ main_user_name }} append=yes groups=fuse
16
+
17 17
 # Check if the /encrypted directory is empty
18 18
 - name: Check for existing encfs
19 19
   shell: ls /encrypted/*

+ 6
- 0
roles/common/tasks/main.yml View File

@@ -60,6 +60,12 @@
60 60
   notify: restart apache
61 61
   when: ansible_distribution_release == 'trusty'
62 62
 
63
+- name: Create decrypted directory (even if encfs isn't used)
64
+  file: state=directory path=/decrypted
65
+
66
+- name: Set decrypted directory permissions
67
+  file: state=directory path=/decrypted group=mail mode=775
68
+
63 69
 - include: encfs.yml tags=encfs
64 70
 - include: users.yml tags=users
65 71
 - include: ssl.yml tags=ssl

+ 1
- 1
roles/common/tasks/users.yml View File

@@ -1,2 +1,2 @@
1 1
 - name: Create main user account
2
-  user: name={{ main_user_name }} state=present shell={{ main_user_shell }} groups=sudo,fuse
2
+  user: name={{ main_user_name }} state=present shell={{ main_user_shell }} groups=sudo

Loading…
Cancel
Save