-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate facts for all sites #15
Conversation
Fortunately I was hesitating with merging this. After playing around with it, I found out this doesn't work at all. The @ypid: I guess I need some help finding a good solution here. What I'm trying to do:
Optionally, I could do a Any ideas, suggestions? |
Lets see if I can help you here.
Hm, that seems to be the most straight forward way to do it. The second way would be to put the public key(s) on the monitoring servers in Ansible facts and play with accessing those facts from the nodes to monitor. That should work but I have never tried that. It might require facts caching or running against the monitoring servers in the same play.
Should be possible. I am not up-to-date with all the fancy stuff in Check_MK and OMD but I guess you can access the SSH public keys using a somewhat deterministic file path? Then you can just put that in Ansible facts. As for how to do it. You can
If it can be expressed in JSON or YAML, then you can set it as Ansible facts. You might have to play a bit with Jinja to make it work but there is always a way. Maybe using a list like in: ---
_site_name:
ssh_publickey:
- pub key
- pub key would make sense. You can just append to a list in Jinja. |
For the Jinja question. You could use a tmp variable to get started? (Untested:) {% set tmp = {{'ssh_publickey': _pubkey}) %}
{% set _ = tmp.update({'ssh_publickey2': _pubkey2}) %}
{% set _ = _site_facts.update({_site_name: tmp}) %} |
It's not trivial to make my idea work with Ansible |
Currently the
checkmk_server
role only allows you to manage one site. However, you may have multiple playbooks for multiple sites or manually manage other sites. If possible also generate facts for other sites, so that thecheckmk_agent
role can relate to them (see debops-contrib/ansible-checkmk_agent#15).