Use groups to manage sudo access rather than editing sudoers file
This commit is contained in:
parent
7e6e630808
commit
106a89d72f
1 changed files with 4 additions and 3 deletions
|
@ -8,7 +8,8 @@
|
|||
become: true
|
||||
|
||||
- name: Give user sudo access
|
||||
lineinfile:
|
||||
path: /etc/sudoers
|
||||
line: "{{ user }} ALL=(ALL) ALL"
|
||||
user:
|
||||
name: "{{ user }}"
|
||||
groups: "{{ 'sudo' if ansible_os_family == 'Debian' else 'wheel' }}"
|
||||
append: true
|
||||
become: true
|
||||
|
|
Loading…
Reference in a new issue