I need to match a string NAME ALL=(ALL) NOPASSWD: ALL
However I'm getting stuck with the parenthesis.
I used a website to help me build the expression but am unable to figure it out.
Thusfar I got:
\sNAME\sALL=\(ALL\)\s\s\s\s\s\s\sNOPASSWD:\sALL
However that doesn't get the parenthesis signs...
Also I use a ton of \s
, which I'm sure there is a better way for?
I'm using the Ansible Lineinfile module to remove the line. All help is appreciated, thank you!
EDIT: Just in case, my little playbook added, might be that I do something wrong there:
Hi.
Yeah it matches in all those generators, but for whatever reason I can't get it working in my playbook, am I such an idiot or?
- hosts: all
become: true
tasks:
- name: Remove user
lineinfile:
dest: /etc/sudoers
regexp: '^.*NAME.*$'
state: 'absent'