system/tasks/sudoers.yml
2022-11-11 17:48:09 +01:00

16 lines
379 B
YAML

- name: set sudoers right
lineinfile:
dest: "/etc/sudoers.d/{{user.name}}"
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
state: "present"
create: True
owner: "root"
group: "root"
mode: "0440"
validate: 'visudo -cf "%s"'
with_items:
- regexp: '^{{user.name}}\s'
line: "{{user.name}} ALL = (ALL) NOPASSWD:ALL"
become: True