Browse Source

Automatically set up passwordless sudo for deploy user.

Closes #343.
Alex Payne 9 years ago
parent
commit
b11fb68559
3 changed files with 5 additions and 3 deletions
  1. 1
    3
      README.md
  2. 3
    0
      roles/common/tasks/users.yml
  3. 1
    0
      roles/common/templates/sudoers.j2

+ 1
- 3
README.md View File

129
     chmod 400 /home/deploy/.ssh/authorized_keys
129
     chmod 400 /home/deploy/.ssh/authorized_keys
130
     chown deploy:deploy /home/deploy -R
130
     chown deploy:deploy /home/deploy -R
131
 
131
 
132
-This account should be set up for passwordless sudo. Use `visudo` and add this line:
133
-
134
-    deploy  ALL=(ALL) NOPASSWD: ALL
132
+Your new account will be automatically set up for passwordless `sudo`.
135
 
133
 
136
 ### 4. Configure your installation
134
 ### 4. Configure your installation
137
 
135
 

+ 3
- 0
roles/common/tasks/users.yml View File

1
 - name: Create main user account
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,fuse
3
+
4
+- name: Give main user account sudo power
5
+  template: src=roles/common/templates/sudoers.j2 dest=/etc/sudoers.d/sudoers owner=root group=root mode=0440 validate='visudo -cf %s'

+ 1
- 0
roles/common/templates/sudoers.j2 View File

1
++{{ main_user_name }} ALL=(ALL) NOPASSWD: ALL

Loading…
Cancel
Save