2 # tasks file for check-mk-agent
4 - name: install Debian packages for Check_MK agent (1/2)
14 - nagios-plugins-basic
16 - name: install Debian packages for Check_MK agent (2/2)
23 name=check-mk-agent-logwatch
24 when: "ansible_distribution_major_version >= '7' and ansible_distribution_major_version < '9'"
26 - name: test for systemd unit files
31 stat: path=/etc/systemd/system/check_mk.socket
32 when: "ansible_distribution_major_version >= '8'"
34 register: check_mk_socket_unit
36 - name: install systemd socket unit files
42 dest=/etc/systemd/system/check_mk.socket
46 src=check_mk.socket.j2
47 when: ansible_distribution_major_version >= '8' and check_mk_socket_unit.stat.exists == False
49 - reload systemd daemon
51 - name: install systemd service unit files
57 dest=/etc/systemd/system/check_mk@.service
61 src=check_mk@.service.j2
62 when: ansible_distribution_major_version >= '8' and check_mk_socket_unit.stat.exists == False
64 - reload systemd daemon
66 - name: enable xinetd configuration
70 dest=/etc/xinetd.d/check_mk
74 regexp="^[\s]*disable[\s]*="
76 when: "ansible_distribution_major_version < '8'"
80 - meta: flush_handlers
87 - name: ensure "check_mk.socket" is enabled and started
95 when: "ansible_distribution_major_version >= '8'"