diff --git a/evolinux-users/templates/sudoers_jessie.j2 b/evolinux-users/templates/sudoers_jessie.j2 index b82c67ac..5ed5b2d0 100644 --- a/evolinux-users/templates/sudoers_jessie.j2 +++ b/evolinux-users/templates/sudoers_jessie.j2 @@ -3,11 +3,5 @@ Defaults umask=0077 Cmnd_Alias MAINT = /usr/share/scripts/evomaintenance.sh, /usr/share/scripts/listupgrade.sh, /usr/bin/apt, /bin/mount User_Alias ADMINS = {{ user.name }} -nagios ALL = NOPASSWD: /usr/lib/nagios/plugins/check_procs -nagios ALL = NOPASSWD: /usr/local/lib/nagios/plugins/check_minifirewall -nagios ALL = NOPASSWD: /usr/local/lib/nagios/plugins/check_haproxy_stats -nagios ALL = NOPASSWD: /usr/sbin/bkctld check -nagios ALL = (clamav) NOPASSWD: /usr/bin/clamscan /tmp/safe.txt - ADMINS ALL = (ALL:ALL) ALL ADMINS ALL = NOPASSWD: MAINT diff --git a/evolinux-users/templates/sudoers_stretch.j2 b/evolinux-users/templates/sudoers_stretch.j2 index 025aa0c2..2dde2ed8 100644 --- a/evolinux-users/templates/sudoers_stretch.j2 +++ b/evolinux-users/templates/sudoers_stretch.j2 @@ -2,11 +2,5 @@ Defaults umask=0077 Cmnd_Alias MAINT = /usr/share/scripts/evomaintenance.sh, /usr/share/scripts/listupgrade.sh, /usr/bin/apt, /bin/mount -nagios ALL = NOPASSWD: /usr/lib/nagios/plugins/check_procs -nagios ALL = NOPASSWD: /usr/local/lib/nagios/plugins/check_minifirewall -nagios ALL = NOPASSWD: /usr/local/lib/nagios/plugins/check_haproxy_stats -nagios ALL = NOPASSWD: /usr/sbin/bkctld check -nagios ALL = (clamav) NOPASSWD: /usr/bin/clamscan /tmp/safe.txt - %{{ evolinux_sudo_group }} ALL=(ALL:ALL) ALL %{{ evolinux_sudo_group }} ALL = NOPASSWD: MAINT diff --git a/nagios-nrpe/tasks/main.yml b/nagios-nrpe/tasks/main.yml index feeaff8e..23e10f41 100644 --- a/nagios-nrpe/tasks/main.yml +++ b/nagios-nrpe/tasks/main.yml @@ -72,3 +72,13 @@ notify: restart nagios-nrpe-server tags: - nagios-nrpe + +- name: Nagios user has proper sudo privileges + copy: + src: nagios_sudoers + dest: /etc/sudoers.d/nagios + mode: "0440" + validate: '/usr/sbin/visudo -cf %s' + tags: + - nagios-nrpe + - nagios-plugins \ No newline at end of file