--- - name: Install packages become: true ansible.builtin.apt: name: - monitoring-plugins-check-logfiles - libnet-ip-perl - name: Copy mailserver services on icinga2 Master delegate_to: "{{ icinga2_master }}" become: true ansible.builtin.template: src: zones.d/master/services/mailserver.conf.j2 dest: /etc/icinga2/zones.d/master/services/mailserver.conf owner: nagios group: nagios mode: 0644 notify: Reload icinga2 service - name: Copy sudoers file for nagios as postgres (for check_pgsql) become: true ansible.builtin.copy: content: 'nagios ALL=(postgres) NOPASSWD:/usr/lib/nagios/plugins/check_pgsql' dest: /etc/sudoers.d/nagios-pgsql owner: root group: root mode: 0440 validate: 'visudo -cf %s' - name: Copy sudoers file for nagios as root (for check_logfiles) become: true ansible.builtin.copy: content: 'nagios ALL=(root) NOPASSWD:/usr/lib/nagios/plugins/check_logfiles' dest: /etc/sudoers.d/nagios-logfiles owner: root group: root mode: 0440 validate: 'visudo -cf %s'