Hello!
I was tasked with creating a Ansible Playbook which sets up CheckMK in an Docker Container and adds all monitors. Currently I am struggling with “finishing” the setup.
If I understand correctly when first starting the docker container with CheckMK in it, it finishes the setup upon the first login of the admin account. The problem is CheckMK (or at least the CheckMK Ansible task checkmk.general.site) doesnt allow a automated login (which would be done normally by the automation user).
The solution to stop the playbook and resume after the user has logged in is not possible because the finished product should be a “one-command”/one-click solution to set up the complete monitoring system.
My Question here is: how can I do this login (or in other terms finish setup) using Ansible or another tool executed by the Ansible playbook?
P.S.: Please note I am very, very new to CheckMK and I have never worked with it before. So if I am completely braindead and this question is “irrelevant” I am sorry.
Hello welcome
I don’t use docker but is that really true? how did you came to that conclution? Im not jugging here just trying to understand where it “failed”
It is correct that at the first start of the container the setup automatically creates the site and so on. But i think you don’t need a direct login to the site to finish this.
Do you have any error messages or problems in your process?
I came to the conclusion after I checked the filesystem in the container (after “finishing” the setup via a login) and there was the automation user password in cleartext in a file. Then I reinstalled the container (remove container and volume) and looked into the filesystem. There was this file missing.
And I read about something similar that the setup finishes after the first login in the Docs.
In my container setups the automation user and his password file exists after the container is created and started without any login in the webpage.
The only step i do after creating the container is an automation to set the password for the cmkadmin account.