Switching to sudoers config files

This commit is contained in:
Tyler Hale 2024-07-25 17:54:48 -06:00
parent 49c2cf296b
commit 8de7d0dfce
Signed by: Tyler
GPG key ID: C7CC4B910D88EF96
3 changed files with 17 additions and 15 deletions

View file

@ -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'

View file

@ -0,0 +1 @@
%sudo ALL=(ALL) NOPASSWD: ALL

View file

@ -0,0 +1 @@
%wheel ALL=(ALL) NOPASSWD: ALL