Git initial commit

This commit is contained in:
lhahn committed 2023-08-20 11:13:04 +02:00
commit 85ce9e0d20
8 files changed
+142

No files matched your search

Executable
+29
View File
@@ -0,0 +1,29 @@
---
- 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
+45
View File
@@ -0,0 +1,45 @@
---
- name: install requirements for checkmk
apt:
update_cache: yes
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
install_recommends: yes
pkg:
- python3-passlib
- name: install checkmk from deb file
apt:
deb: "{{ checkmk_server_source }}"
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
install_recommends: yes
# apache2 is default installed via e.g. deb file
# in order to run e.g. nginx as webserver, we should disable it
- name: adjust apache2 systemd unit state
systemd:
name: apache2
enabled: "{{ checkmk_system_apache2 | default('no') | bool }}"
daemon_reload: yes
- name: generate checkmk sites
command:
cmd: "omd create {{ item }}"
creates: "/omd/sites/{{ item }}"
notify: restart omd
loop: "{{ checkmk_server_sites }}"
- name: setup admin password for sites
htpasswd:
path: "/omd/sites/{{ cmk_site }}/etc/htpasswd"
name: "{{ checkmk_admin_user }}"
password: "{{ checkmk_admin_pass }}"
owner: "{{ cmk_site }}"
group: "{{ cmk_site }}"
mode: 0660
become: yes
become_user: "{{ cmk_site }}"
loop: "{{ checkmk_server_sites }}"
loop_control:
loop_var: cmk_site
label: "site: {{ cmk_site }}"