I'm attempting to add a custom permission (see below) set to the sudoers file (ubuntu) via ansible so I can automate the process for setting up an audit user across our linux servers.
user ALL=(root) /sbin/dmidecode,/usr/bin/fdisk -l,/usr/bin/multipath -ll,/usr/bin/dmsetup table *,/usr/bin/dmsetup ls,/sbin/lsof,/usr/bin/cat,/usr/bin/cut,/usr/sbin/lshw,/usr/bin/ls,/usr/bin/netstat,/usr/sbin/ss,/usr/bin/stat
I've seen some people recommend the below similar module:
- name: User Managment | Update sudoers file with permissions ansible.builtin.lineinfile: dest: /etc/sudoers state: present regexp:
I'm new to anisble so still learning