--- # tasks file for check-mk-agent - name: install Debian packages for Check_MK agent (1/2) tags: - check_mk - monitoring - packages apt: state: present name: [ 'check-mk-agent', 'monitoring-plugins-basic', ] - name: install Debian packages for Check_MK agent (2/2) tags: - check_mk - monitoring - packages apt: > state=present name=check-mk-agent-logwatch when: "ansible_distribution_major_version|int >= 7 and ansible_distribution_major_version|int < 9" - name: enable xinetd configuration tags: - check_mk lineinfile: > dest=/etc/xinetd.d/check_mk group=root mode=0644 owner=root regexp="^[\s]*disable[\s]*=" state=absent when: "ansible_distribution_major_version|int < 8" notify: - restart "xinetd" - meta: flush_handlers tags: - check_mk - name: ensure "check_mk.socket" is enabled and started tags: - check_mk - monitoring service: > enabled=yes name=check_mk.socket state=started when: "ansible_distribution_major_version|int >= 8"