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
|
become: true
|
||||||
|
|
||||||
- name: Give user sudo access
|
- name: Give user sudo access
|
||||||
lineinfile:
|
user:
|
||||||
path: /etc/sudoers
|
name: "{{ user }}"
|
||||||
line: "{{ user }} ALL=(ALL) ALL"
|
groups: "{{ 'sudo' if ansible_os_family == 'Debian' else 'wheel' }}"
|
||||||
|
append: true
|
||||||
become: true
|
become: true
|
||||||
|
|
Loading…
Reference in a new issue