diff --git a/playbooks/tags_nagios.yml b/playbooks/tags_nagios.yml index 3811072..c45a98a 100755 --- a/playbooks/tags_nagios.yml +++ b/playbooks/tags_nagios.yml @@ -22,6 +22,16 @@ state: present key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNavw28C0mKIQVRLQDW2aoovliU1XCGaenDhIMwumK/ Nagios monitoring" tags: [ nagios ] + - name: assure nagios user sudo rule file + file: path=/etc/sudoers.d/50-nagios-checker mode=0750 owner=root group=root state=touch modification_time=preserve access_time=preserve + tags: [ nagios, sudo ] + - name: assure nagios user sudo rules + lineinfile: + path: /etc/sudoers.d/50-nagios-checker + line: "nagios-checker ALL = (root) NOPASSWD: {{ item }}" + with_items: + - /usr/lib/nagios/plugins/check_disk + tags: [ nagios, sudo ] - hosts: all tasks: - name: disable nagios user when not tagged