Switching to sudoers config files
This commit is contained in:
parent
49c2cf296b
commit
8de7d0dfce
3 changed files with 17 additions and 15 deletions
|
@ -1,18 +1,18 @@
|
|||
---
|
||||
# file: roles/base/tasks/core_sudo.yml
|
||||
|
||||
- name: Enabled passwordless for wheel group
|
||||
lineinfile:
|
||||
path: /etc/sudoers
|
||||
state: present
|
||||
regexp: '^%wheel'
|
||||
line: '%wheel ALL=(ALL) NOPASSWD: ALL'
|
||||
validate: 'visudo -cf %s'
|
||||
- name: Configure passwordless for wheel group
|
||||
template:
|
||||
src: "%wheel.j2"
|
||||
dest: "/etc/sudoers.d/%wheel"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0440'
|
||||
|
||||
- name: Enabled passwordless for sudo group
|
||||
lineinfile:
|
||||
path: /etc/sudoers
|
||||
state: present
|
||||
regexp: '^%sudo'
|
||||
line: '%sudo ALL=(ALL:ALL) NOPASSWD: ALL'
|
||||
validate: 'visudo -cf %s'
|
||||
- name: Configure passwordless for sudo group
|
||||
template:
|
||||
src: "%sudo.j2"
|
||||
dest: "/etc/sudoers.d/%sudo"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0440'
|
||||
|
|
1
roles/base/templates/%sudo.j2
Normal file
1
roles/base/templates/%sudo.j2
Normal file
|
@ -0,0 +1 @@
|
|||
%sudo ALL=(ALL) NOPASSWD: ALL
|
1
roles/base/templates/%wheel.j2
Normal file
1
roles/base/templates/%wheel.j2
Normal file
|
@ -0,0 +1 @@
|
|||
%wheel ALL=(ALL) NOPASSWD: ALL
|
Loading…
Reference in a new issue