Ansible role server error: "The task includes an option with an undefined variable."

CMK version:

Not relevant
OS version:
Rocky9
Error message:
"The task includes an option with an undefined variable.

First, I am an absolute beginner with Ansible.
We are currently testing the Ansible role server and I use the tag ‘install-package to install’ check_mk from local repo. Beside that we set checkmk_server_edition=cee and checkmk_server_version=2.2.0p11

{"msg": "The task includes an option with an undefined variable. The error was: {{ checkmk_server_base_url }}/{{ checkmk_server_version }}/{{ checkmk_server_setup_file }}: 'checkmk_server_setup_file' is undefined. 'checkmk_server_setup_file' is undefined. {{ checkmk_server_base_url }}/{{ checkmk_server_version }}/{{ checkmk_server_setup_file }}: 'checkmk_server_setup_file' is undefined. 'checkmk_server_setup_file' is undefined\n\nThe error appears to be in '/etc/ansible/roles/server/tasks/main.yml': line 44, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - name: \"Download Checkmk Server Setup.\"\n      ^ here\n"}

Some of this variables I dont see in the role server.
I went through the doc on github, but found nothing. What did I missed here?

Thanks

Michael

The error message suggests, that for some reason the variables in vars/ were ignored. This is where we build the variables for e.g., the setup files based on the distribution.
Are you gathering facts on playbook run, or do you skip that?
That would be gather_facts: smart in the playbook header (or a setting in ansible.cfg).

Hi Robin,

Thank you for your answer.
I am using Ansible with Katello/Foreman and it looks like that the variables from vars
are not imported. I just created some of them by hand and now I get different errror even that I used the tag install-package

{"changed": false, "dest": "/tmp/check-mk-enterprise-2.2.0p11-el9-38.x86_64.rpm", "elapsed": 10, "msg": "Request failed: <urlopen error timed out>", "url": "https://download.checkmk.com/checkmk/2.2.0p11/check-mk-enterprise-2.2.0p11-el9-38.x86_64.rpm"}

Hi @mike1098 then you probably want to understand, why Katello/Foreman ignore those variables, as they are essential for pretty much any role, that has this vars/ directory.

Regarding the new error: You might want to understand, which host is carrying out this task and if that host has permission to access the internet.