cloud-checkmk/tasks/main.yml
2023-08-20 10:30:28 +02:00

30 lines
884 B
YAML
Executable File

---
- name: install checkmk server
include_tasks: server.yml
when: checkmk_is_server | bool
- name: install requirements for checkmk agents
apt:
update_cache: yes
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
install_recommends: yes
pkg:
- xinetd
- name: install agent from monitoring server
apt:
deb: "{{ checkmk_agent_source }}"
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
install_recommends: yes
ignore_errors: yes
# if the monitoring server is not fast enough online...
- name: restrict metrics access via xinetd only for montoring server
lineinfile:
path: "/etc/xinetd.d/check_mk"
regexp: '^\s*#?only_from\s*='
line: "\tonly_from = {{ checkmk_server_ip }}"
ignore_errors: yes # if the monitoring server is not fast enough online...
notify: restart xinetd