Skip to content

Commit

Permalink
Use community.general.sudoers for unprivileged_user sudoers control
Browse files Browse the repository at this point in the history
  • Loading branch information
wbclark committed Aug 31, 2022
1 parent 27e491c commit 625308a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions roles/unprivileged_user/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@
become: true

- name: "Grant passwordless sudo via {{ unprivileged_user_groupname }} group"
ansible.builtin.lineinfile:
dest: "/etc/sudoers.d/{{ unprivileged_user_groupname }}"
state: present
regexp: '^%{{ unprivileged_user_groupname }}'
line: '%{{ unprivileged_user_groupname }} ALL=(ALL) NOPASSWD: ALL'
validate: '/usr/sbin/visudo -cf %s'
create: yes
community.general.sudoers:
name: "{{ unprivileged_user_groupname }}"
group: "{{ unprivileged_user_groupname }}"
commands: ALL
become: true

- name: "Add public key to authorized_keys from Host Machine"
Expand Down

0 comments on commit 625308a

Please sign in to comment.