Closed hasselk closed 5 months ago
I have not tested this yet, but from a quick look at the code this issue seems valid.
Now there are different approaches in how to handle this. In general, we need to check first, whether the variable checkmk_agent_server
is an IP. Based on that we can use the IP, or we need to look up the IP address. While this sounds trivial, there can be several caveats: Firstly, is the name resolvable? If so, is the resolved IP the correct one (thinking about NAT here). And there is probably more.
Of course one could go the less smart way and just add the internally-used variable checkmk_agent_server_ip
to the defaults and set it explicitly. That would make things easier on the one hand, but more error-prone on the other.
I need to think about this and look at the available options from a technical perspective.
Hey @hasselk! I implemented something in #597, that should help you solve your issue. Please let me know what you think. Maybe even leave a review. :)
As there was no feedback and 5.0.0
was released over the weekend, I consider this done.
Describe the bug
It seems the Firewall Rules (Redhat and Debian) are only created if the checkmk_agent_server is an Ip address and skipped when not, which seems a bit Odd since you need an FQDN if you want to use https and check the cert.
Component Name
Component Name: roles/agent/tasks/ Debian.yml and Redhat.yml
Ansible Version
Checkmk Version and Edition
Collection Version
To Reproduce Steps to reproduce the behavior: run a playbook that uses the agent role with an FQDN as the checkmk_agent_server and set checkmk_agent_configure_firewall: 'true' FW Rule does not get generated
Expected behavior convert the FQDN to an IP and use that as the checkmk_agent_server_ip
Actual behavior Currently the Firewall Rule generation gets completly skipped if checkmk_agent_server is not an ip
Minimum reproduction example
Additional context